diff --git a/Source/BoundaryConditions/BoundaryConditions_xvel.cpp b/Source/BoundaryConditions/BoundaryConditions_xvel.cpp index 5a2dd27e..ca13bc25 100644 --- a/Source/BoundaryConditions/BoundaryConditions_xvel.cpp +++ b/Source/BoundaryConditions/BoundaryConditions_xvel.cpp @@ -161,6 +161,34 @@ void REMORAPhysBCFunct::impose_xvel_bcs (const Array4& dest_arr, const Box ); } // z + if ((!is_periodic_in_x or bccomp==BCVars::foextrap_bc) and + (!is_periodic_in_y or bccomp==BCVars::foextrap_bc)) { + Box xlo(bx); xlo.setBig (0,dom_lo.x ); + Box xhi(bx); xhi.setSmall(0,dom_hi.x+1); + Box ylo(bx); ylo.setBig (1,dom_lo.y-1); + Box yhi(bx); yhi.setSmall(1,dom_hi.y+1); + Box xlo_ylo = xlo & ylo; + Box xlo_yhi = xlo & yhi; + Box xhi_ylo = xhi & ylo; + Box xhi_yhi = xhi & yhi; + ParallelFor(xlo_ylo, [=] AMREX_GPU_DEVICE (int i, int j, int k) + { + dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_lo.y,k) + dest_arr(dom_lo.x+1,j,k)); + }); + ParallelFor(xlo_yhi, [=] AMREX_GPU_DEVICE (int i, int j, int k) + { + dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_hi.y,k) + dest_arr(dom_lo.x+1,j,k)); + }); + ParallelFor(xhi_ylo, [=] AMREX_GPU_DEVICE (int i, int j, int k) + { + dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_lo.y,k) + dest_arr(dom_hi.x,j,k)); + }); + ParallelFor(xhi_yhi, [=] AMREX_GPU_DEVICE (int i, int j, int k) + { + dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_hi.y,k) + dest_arr(dom_hi.x,j,k)); + }); + } + Gpu::streamSynchronize(); } diff --git a/Source/BoundaryConditions/BoundaryConditions_yvel.cpp b/Source/BoundaryConditions/BoundaryConditions_yvel.cpp index 797f7da4..4ae26c19 100644 --- a/Source/BoundaryConditions/BoundaryConditions_yvel.cpp +++ b/Source/BoundaryConditions/BoundaryConditions_yvel.cpp @@ -163,5 +163,33 @@ void REMORAPhysBCFunct::impose_yvel_bcs (const Array4& dest_arr, const Box ); } + if ((!is_periodic_in_x or bccomp==BCVars::foextrap_bc) and + (!is_periodic_in_y or bccomp==BCVars::foextrap_bc)) { + Box xlo(bx); xlo.setBig (0,dom_lo.x-1); + Box xhi(bx); xhi.setSmall(0,dom_hi.x+1); + Box ylo(bx); ylo.setBig (1,dom_lo.y ); + Box yhi(bx); yhi.setSmall(1,dom_hi.y+1); + Box xlo_ylo = xlo & ylo; + Box xlo_yhi = xlo & yhi; + Box xhi_ylo = xhi & ylo; + Box xhi_yhi = xhi & yhi; + ParallelFor(xlo_ylo, [=] AMREX_GPU_DEVICE (int i, int j, int k) + { + dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_lo.y+1,k) + dest_arr(dom_lo.x,j,k)); + }); + ParallelFor(xlo_yhi, [=] AMREX_GPU_DEVICE (int i, int j, int k) + { + dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_hi.y,k) + dest_arr(dom_lo.x,j,k)); + }); + ParallelFor(xhi_ylo, [=] AMREX_GPU_DEVICE (int i, int j, int k) + { + dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_lo.y+1,k) + dest_arr(dom_hi.x,j,k)); + }); + ParallelFor(xhi_yhi, [=] AMREX_GPU_DEVICE (int i, int j, int k) + { + dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_hi.y,k) + dest_arr(dom_hi.x,j,k)); + }); + } + Gpu::streamSynchronize(); } diff --git a/Source/REMORA.cpp b/Source/REMORA.cpp index 17f92468..4c30012c 100644 --- a/Source/REMORA.cpp +++ b/Source/REMORA.cpp @@ -679,7 +679,10 @@ REMORA::init_only (int lev, Real time) init_set_vmix(lev); set_hmixcoef(lev); set_coriolis(lev); + init_custom_smflux(geom[lev], time, *vec_sustr[lev], *vec_svstr[lev], solverChoice); + vec_sustr[lev]->OverrideSync(geom[lev].periodicity()); + vec_svstr[lev]->OverrideSync(geom[lev].periodicity()); }