Skip to content

Commit

Permalink
fix index bug in fillpatching (#1900)
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren authored Oct 20, 2024
1 parent feb7843 commit 291c02c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using namespace amrex;

void ERFPhysBCFunct_base::impose_lateral_basestate_bcs (const Array4<Real>& dest_arr, const Box& bx, const Box& domain)
{
BL_PROFILE_VAR("impose_lateral_cons_bcs()",impose_lateral_cons_bcs);
BL_PROFILE_VAR("impose_lateral_base_bcs()",impose_lateral_base_bcs);

int icomp = 0;
int ncomp = 3;
Expand Down
2 changes: 1 addition & 1 deletion Source/BoundaryConditions/ERF_BoundaryConditions_cons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void ERFPhysBCFunct_cons::impose_vertical_cons_bcs (const Array4<Real>& dest_arr
const GpuArray<Real,AMREX_SPACEDIM> dxInv,
int icomp, int ncomp)
{
BL_PROFILE_VAR("impose_lateral_cons_bcs()",impose_lateral_cons_bcs);
BL_PROFILE_VAR("impose_vertical_cons_bcs()",impose_vertical_cons_bcs);
const auto& dom_lo = lbound(domain);
const auto& dom_hi = ubound(domain);

Expand Down
2 changes: 1 addition & 1 deletion Source/BoundaryConditions/ERF_FillPatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ ERF::FillIntermediatePatch (int lev, Real time,
mapper = &cell_cons_interp;
FillPatchTwoLevels(mf, IntVect{ng_cons}, IntVect(0,0,0),
time, cmf, ctime, fmf, ftime,
0, 0, ncomp_cons, geom[lev-1], geom[lev],
icomp_cons, icomp_cons, ncomp_cons, geom[lev-1], geom[lev],
refRatio(lev-1), mapper, domain_bcs_type,
icomp_cons);

Expand Down
8 changes: 6 additions & 2 deletions Source/TimeIntegration/ERF_TI_fast_rhs_fun.H
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,16 @@ auto fast_rhs_fun = [&](int fast_step, int /*n_sub*/, int nrk,
detJ_cc[level], r0, pi0, dtau, beta_s, phys_bc_type);

// If this is the first substep we pass in S_old as the previous step's solution
// and S_data is the new-time solution to be defined here
erf_fast_rhs_T(fast_step, nrk, level, finest_level,
S_slow_rhs, S_old, S_stage, S_prim, pi_stage, fast_coeffs,
S_data, S_scratch, fine_geom, solverChoice.gravity, Omega,
z_phys_nd[level], detJ_cc[level], dtau, beta_s, inv_fac,
mapfac_m[level], mapfac_u[level], mapfac_v[level],
fr_as_crse, fr_as_fine, l_use_moisture, l_reflux, l_implicit_substepping);
} else {
// If this is not the first substep we pass in S_data as the previous step's solution
// If this is not the first substep we pass in S_data as both the previous step's solution
// and as the new-time solution to be defined here
erf_fast_rhs_T(fast_step, nrk, level, finest_level,
S_slow_rhs, S_data, S_stage, S_prim, pi_stage, fast_coeffs,
S_data, S_scratch, fine_geom, solverChoice.gravity, Omega,
Expand All @@ -152,14 +154,16 @@ auto fast_rhs_fun = [&](int fast_step, int /*n_sub*/, int nrk,
detJ_cc[level], r0, pi0, dtau, beta_s, phys_bc_type);

// If this is the first substep we pass in S_old as the previous step's solution
// and S_data is the new-time solution to be defined here
erf_fast_rhs_N(fast_step, nrk, level, finest_level,
S_slow_rhs, S_old, S_stage, S_prim, pi_stage, fast_coeffs,
S_data, S_scratch, fine_geom, solverChoice.gravity,
dtau, beta_s, inv_fac,
mapfac_m[level], mapfac_u[level], mapfac_v[level],
fr_as_crse, fr_as_fine, l_use_moisture, l_reflux, l_implicit_substepping);
} else {
// If this is not the first substep we pass in S_data as the previous step's solution
// If this is not the first substep we pass in S_data as both the previous step's solution
// and as the new-time solution to be defined here
erf_fast_rhs_N(fast_step, nrk, level, finest_level,
S_slow_rhs, S_data, S_stage, S_prim, pi_stage, fast_coeffs,
S_data, S_scratch, fine_geom, solverChoice.gravity,
Expand Down

0 comments on commit 291c02c

Please sign in to comment.