From 1c9bb68d127e7a960f826f2b062c500a64345e9b Mon Sep 17 00:00:00 2001 From: cgilet Date: Thu, 29 May 2025 21:28:29 +0200 Subject: [PATCH 1/4] Fix out-of-bounds error in IncfloVelFill when doing u_mac fillpatch --- src/prob/prob_bc.H | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/prob/prob_bc.H b/src/prob/prob_bc.H index 74c4878e..08255cb9 100644 --- a/src/prob/prob_bc.H +++ b/src/prob/prob_bc.H @@ -44,14 +44,14 @@ struct IncfloVelFill if (i < domain_box.smallEnd(0)) { int dir = 0; - amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::low)][orig_comp+dir]; + amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::low)][dir]; int td1 = (dir+1)%AMREX_SPACEDIM; - amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::low)][orig_comp+td1]; + amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::low)][td1]; #if (AMREX_SPACEDIM == 3) int td2 = (dir+2)%AMREX_SPACEDIM; - amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::low)][orig_comp+td2]; + amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::low)][td2]; #endif // This may modify the normal velocity for specific problems @@ -115,14 +115,14 @@ struct IncfloVelFill if (i > domain_box.bigEnd(0)) { int dir = 0; - amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::high)][orig_comp+dir]; + amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::high)][dir]; int td1 = (dir+1)%AMREX_SPACEDIM; - amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::high)][orig_comp+td1]; + amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::high)][td1]; #if (AMREX_SPACEDIM == 3) int td2 = (dir+2)%AMREX_SPACEDIM; - amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::high)][orig_comp+td2]; + amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::high)][td2]; #endif // This may modify the normal velocity for specific problems @@ -173,14 +173,14 @@ struct IncfloVelFill if (j < domain_box.smallEnd(1)) { int dir = 1; - amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::low)][orig_comp+dir]; + amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::low)][dir]; int td1 = (dir+1)%AMREX_SPACEDIM; - amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::low)][orig_comp+td1]; + amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::low)][td1]; #if (AMREX_SPACEDIM == 3) int td2 = (dir+2)%AMREX_SPACEDIM; - amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::low)][orig_comp+td2]; + amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::low)][td2]; #endif // This may modify the normal velocity for specific problems @@ -222,14 +222,14 @@ struct IncfloVelFill if (j > domain_box.bigEnd(1)) { int dir = 1; - amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::high)][orig_comp+dir]; + amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::high)][dir]; int td1 = (dir+1)%AMREX_SPACEDIM; - amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::high)][orig_comp+td1]; + amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::high)][td1]; #if (AMREX_SPACEDIM == 3) int td2 = (dir+2)%AMREX_SPACEDIM; - amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::high)][orig_comp+td2]; + amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::high)][td2]; #endif // This may modify the normal velocity for specific problems @@ -277,13 +277,13 @@ struct IncfloVelFill if (k < domain_box.smallEnd(2)) { int dir = 2; - amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)][orig_comp+dir]; + amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)][dir]; int td1 = (dir+1)%AMREX_SPACEDIM; - amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)][orig_comp+td1]; + amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)][td1]; int td2 = (dir+2)%AMREX_SPACEDIM; - amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)][orig_comp+td2]; + amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)][td2]; // This may modify the normal velocity for specific problems if (33 == probtype) @@ -321,13 +321,13 @@ struct IncfloVelFill if (k > domain_box.bigEnd(2)) { int dir = 2; - amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::high)][orig_comp+dir]; + amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::high)][dir]; int td1 = (dir+1)%AMREX_SPACEDIM; - amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::high)][orig_comp+td1]; + amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::high)][td1]; int td2 = (dir+2)%AMREX_SPACEDIM; - amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::high)][orig_comp+td2]; + amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::high)][td2]; if ( (bc.hi(dir) == amrex::BCType::ext_dir) || (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel <= 0.) ) From af0f448691c0a1784fc4a6c6b820176e012c0bd4 Mon Sep 17 00:00:00 2001 From: cgilet Date: Mon, 2 Jun 2025 12:56:42 +0200 Subject: [PATCH 2/4] Get correct bc value when only doing one component (i.e. MAC vel) --- src/prob/prob_bc.H | 105 +++------------------------------------------ 1 file changed, 6 insertions(+), 99 deletions(-) diff --git a/src/prob/prob_bc.H b/src/prob/prob_bc.H index 08255cb9..838f1d76 100644 --- a/src/prob/prob_bc.H +++ b/src/prob/prob_bc.H @@ -46,14 +46,6 @@ struct IncfloVelFill int dir = 0; amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::low)][dir]; - int td1 = (dir+1)%AMREX_SPACEDIM; - amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::low)][td1]; - -#if (AMREX_SPACEDIM == 3) - int td2 = (dir+2)%AMREX_SPACEDIM; - amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::low)][td2]; -#endif - // This may modify the normal velocity for specific problems if (42 == probtype) { @@ -93,15 +85,7 @@ struct IncfloVelFill else if ( (bc.lo(dir) == amrex::BCType::ext_dir) || (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel >= 0.) ) { - if (nc == dir) { - vel(i,j,k,dcomp+nc) = norm_vel; - } else if (nc == td1) { - vel(i,j,k,dcomp+nc) = tang_vel1; -#if (AMREX_SPACEDIM == 3) - } else if (nc == td2) { - vel(i,j,k,dcomp+nc) = tang_vel2; -#endif - } + vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::low)][orig_comp+nc]; } else if (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel < 0.) { @@ -117,14 +101,6 @@ struct IncfloVelFill int dir = 0; amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::high)][dir]; - int td1 = (dir+1)%AMREX_SPACEDIM; - amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::high)][td1]; - -#if (AMREX_SPACEDIM == 3) - int td2 = (dir+2)%AMREX_SPACEDIM; - amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::high)][td2]; -#endif - // This may modify the normal velocity for specific problems if (42 == probtype) { @@ -147,26 +123,14 @@ struct IncfloVelFill else if ( (bc.hi(dir) == amrex::BCType::ext_dir) || (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel <= 0.) ) { - if (nc == dir) { - vel(i,j,k,dcomp+nc) = norm_vel; - } else if (nc == td1) { - vel(i,j,k,dcomp+nc) = tang_vel1; -#if (AMREX_SPACEDIM == 3) - } else if (nc == td2) { - vel(i,j,k,dcomp+nc) = tang_vel2; -#endif - } + vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::high)][orig_comp+nc]; } else if (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel > 0.) { vel(i,j,k,dcomp+nc) = vel(i-1,j,k,dcomp+nc); } - } // high i - { - } - // ********************************************************************************************** // LOW J // ********************************************************************************************** @@ -175,14 +139,6 @@ struct IncfloVelFill int dir = 1; amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::low)][dir]; - int td1 = (dir+1)%AMREX_SPACEDIM; - amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::low)][td1]; - -#if (AMREX_SPACEDIM == 3) - int td2 = (dir+2)%AMREX_SPACEDIM; - amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::low)][td2]; -#endif - // This may modify the normal velocity for specific problems #if (AMREX_SPACEDIM == 3) if (32 == probtype) @@ -200,15 +156,7 @@ struct IncfloVelFill if ( (bc.lo(dir) == amrex::BCType::ext_dir) || (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel >= 0.) ) { - if (nc == dir) { - vel(i,j,k,dcomp+nc) = norm_vel; - } else if (nc == td1) { - vel(i,j,k,dcomp+nc) = tang_vel1; -#if (AMREX_SPACEDIM == 3) - } else if (nc == td2) { - vel(i,j,k,dcomp+nc) = tang_vel2; -#endif - } + vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::low)][orig_comp+nc]; } else if (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel < 0.) { @@ -224,14 +172,6 @@ struct IncfloVelFill int dir = 1; amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::high)][dir]; - int td1 = (dir+1)%AMREX_SPACEDIM; - amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::high)][td1]; - -#if (AMREX_SPACEDIM == 3) - int td2 = (dir+2)%AMREX_SPACEDIM; - amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::high)][td2]; -#endif - // This may modify the normal velocity for specific problems if (16 == probtype) { @@ -253,15 +193,7 @@ struct IncfloVelFill if ( (bc.hi(dir) == amrex::BCType::ext_dir) || (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel <= 0.) ) { - if (nc == dir) { - vel(i,j,k,dcomp+nc) = norm_vel; - } else if (nc == td1) { - vel(i,j,k,dcomp+nc) = tang_vel1; -#if (AMREX_SPACEDIM == 3) - } else if (nc == td2) { - vel(i,j,k,dcomp+nc) = tang_vel2; -#endif - } + vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::high)][orig_comp+nc]; } else if (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel > 0.) { @@ -279,12 +211,6 @@ struct IncfloVelFill int dir = 2; amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)][dir]; - int td1 = (dir+1)%AMREX_SPACEDIM; - amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)][td1]; - - int td2 = (dir+2)%AMREX_SPACEDIM; - amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)][td2]; - // This may modify the normal velocity for specific problems if (33 == probtype) { @@ -300,19 +226,12 @@ struct IncfloVelFill if ( (bc.lo(dir) == amrex::BCType::ext_dir) || (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel <= 0.) ) { - if (nc == dir) { - vel(i,j,k,dcomp+nc) = norm_vel; - } else if (nc == td1) { - vel(i,j,k,dcomp+nc) = tang_vel1; - } else if (nc == td2) { - vel(i,j,k,dcomp+nc) = tang_vel2; - } + vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)][orig_comp+nc]; } else if (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel > 0.) { vel(i,j,k,dcomp+nc) = vel(i,j,k+1,dcomp+nc); } - } // low k // ********************************************************************************************** @@ -323,22 +242,10 @@ struct IncfloVelFill int dir = 2; amrex::Real norm_vel = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::high)][dir]; - int td1 = (dir+1)%AMREX_SPACEDIM; - amrex::Real tang_vel1 = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::high)][td1]; - - int td2 = (dir+2)%AMREX_SPACEDIM; - amrex::Real tang_vel2 = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::high)][td2]; - if ( (bc.hi(dir) == amrex::BCType::ext_dir) || (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel <= 0.) ) { - if (nc == dir) { - vel(i,j,k,dcomp+nc) = norm_vel; - } else if (nc == td1) { - vel(i,j,k,dcomp+nc) = tang_vel1; - } else if (nc == td2) { - vel(i,j,k,dcomp+nc) = tang_vel2; - } + vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::high)][orig_comp+nc]; } else if (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel > 0.) { From 375fbe3533f93a9daac5ab20a51904f24ee6133e Mon Sep 17 00:00:00 2001 From: cgilet Date: Mon, 2 Jun 2025 13:37:03 +0200 Subject: [PATCH 3/4] Some probtypes change norm_vel and need to keep that. --- src/prob/prob_bc.H | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/src/prob/prob_bc.H b/src/prob/prob_bc.H index 838f1d76..62dc0645 100644 --- a/src/prob/prob_bc.H +++ b/src/prob/prob_bc.H @@ -85,7 +85,11 @@ struct IncfloVelFill else if ( (bc.lo(dir) == amrex::BCType::ext_dir) || (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel >= 0.) ) { - vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::low)][orig_comp+nc]; + if ( orig_comp+nc == dir ) { + vel(i,j,k,dcomp+nc) = norm_vel; + } else { + vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::low)][orig_comp+nc]; + } } else if (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel < 0.) { @@ -123,7 +127,11 @@ struct IncfloVelFill else if ( (bc.hi(dir) == amrex::BCType::ext_dir) || (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel <= 0.) ) { - vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::high)][orig_comp+nc]; + if ( orig_comp+nc == dir ) { + vel(i,j,k,dcomp+nc) = norm_vel; + } else { + vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::x,amrex::Orientation::high)][orig_comp+nc]; + } } else if (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel > 0.) { @@ -156,7 +164,11 @@ struct IncfloVelFill if ( (bc.lo(dir) == amrex::BCType::ext_dir) || (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel >= 0.) ) { - vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::low)][orig_comp+nc]; + if ( orig_comp+nc == dir ) { + vel(i,j,k,dcomp+nc) = norm_vel; + } else { + vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::low)][orig_comp+nc]; + } } else if (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel < 0.) { @@ -193,7 +205,11 @@ struct IncfloVelFill if ( (bc.hi(dir) == amrex::BCType::ext_dir) || (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel <= 0.) ) { - vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::high)][orig_comp+nc]; + if ( orig_comp+nc == dir ) { + vel(i,j,k,dcomp+nc) = norm_vel; + } else { + vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::y,amrex::Orientation::high)][orig_comp+nc]; + } } else if (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel > 0.) { @@ -226,7 +242,11 @@ struct IncfloVelFill if ( (bc.lo(dir) == amrex::BCType::ext_dir) || (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel <= 0.) ) { - vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)][orig_comp+nc]; + if ( orig_comp+nc == dir ) { + vel(i,j,k,dcomp+nc) = norm_vel; + } else { + vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)][orig_comp+nc]; + } } else if (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel > 0.) { @@ -245,7 +265,11 @@ struct IncfloVelFill if ( (bc.hi(dir) == amrex::BCType::ext_dir) || (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel <= 0.) ) { - vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::high)][orig_comp+nc]; + if ( orig_comp+nc == dir ) { + vel(i,j,k,dcomp+nc) = norm_vel; + } else { + vel(i,j,k,dcomp+nc) = bcv_vel[amrex::Orientation(amrex::Direction::z,amrex::Orientation::high)][orig_comp+nc]; + } } else if (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel > 0.) { From 6f1156195ef4ab86aed094b3daf92449db8ced0b Mon Sep 17 00:00:00 2001 From: cgilet Date: Tue, 3 Jun 2025 07:58:17 +0200 Subject: [PATCH 4/4] If direction_dependent BC flows into domain, take the normal vel component in the closest valid cell instead. Must use bigEnd/smallEnd because if ng>1, i+1 could still be a ghost cell. --- src/prob/prob_bc.H | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/prob/prob_bc.H b/src/prob/prob_bc.H index 62dc0645..f1cf47ad 100644 --- a/src/prob/prob_bc.H +++ b/src/prob/prob_bc.H @@ -93,7 +93,7 @@ struct IncfloVelFill } else if (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel < 0.) { - vel(i,j,k,dcomp+nc) = vel(i+1,j,k,dcomp+nc); + vel(i,j,k,dcomp+nc) = vel(domain_box.smallEnd(0),j,k,dcomp+nc); } } // low i @@ -135,7 +135,7 @@ struct IncfloVelFill } else if (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel > 0.) { - vel(i,j,k,dcomp+nc) = vel(i-1,j,k,dcomp+nc); + vel(i,j,k,dcomp+nc) = vel(domain_box.bigEnd(0),j,k,dcomp+nc); } } // high i @@ -172,7 +172,7 @@ struct IncfloVelFill } else if (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel < 0.) { - vel(i,j,k,dcomp+nc) = vel(i,j+1,k,dcomp+nc); + vel(i,j,k,dcomp+nc) = vel(i,domain_box.smallEnd(1),k,dcomp+nc); } } // low j @@ -213,7 +213,7 @@ struct IncfloVelFill } else if (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel > 0.) { - vel(i,j,k,dcomp+nc) = vel(i,j-1,k,dcomp+nc); + vel(i,j,k,dcomp+nc) = vel(i,domain_box.bigEnd(1),k,dcomp+nc); } } // not 1102 } // high j @@ -250,7 +250,7 @@ struct IncfloVelFill } else if (bc.lo(dir) == amrex::BCType::direction_dependent && norm_vel > 0.) { - vel(i,j,k,dcomp+nc) = vel(i,j,k+1,dcomp+nc); + vel(i,j,k,dcomp+nc) = vel(i,j,domain_box.smallEnd(2),dcomp+nc); } } // low k @@ -273,7 +273,7 @@ struct IncfloVelFill } else if (bc.hi(dir) == amrex::BCType::direction_dependent && norm_vel > 0.) { - vel(i,j,k,dcomp+nc) = vel(i,j,k-1,dcomp+nc); + vel(i,j,k,dcomp+nc) = vel(i,j,domain_box.bigEnd(2),dcomp+nc); } } // high k #endif // 3d