Skip to content

Commit

Permalink
Fix 2d eb slope limiting (AMReX-Codes#2226)
Browse files Browse the repository at this point in the history
There was a bug in the 2D EB slope limiting -- this fixes that
  • Loading branch information
asalmgren authored Aug 8, 2021
1 parent 867d1de commit a2ad625
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Src/EB/AMReX_EB_slopes_K.H
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,8 @@ amrex_calc_alpha_limiter(int i, int j, int k, int n,
// Compute max and min values in a 3x2 stencil
for(int jj(0); jj<=1; jj++){
for(int ii(-1); ii<=1; ii++){
if( flag(i,j,k).isConnected(ii,jj,kk) and
not (ii==0 and jj==0 and kk==0)) {
if ( flag(i,j,k).isConnected(ii,jj,kk) and
not (ii==0 and jj==0) ) {
if (state(i+ii,j+jj,k+kk,n) > q_max) q_max = state(i+ii,j+jj,k+kk,n);
if (state(i+ii,j+jj,k+kk,n) < q_min) q_min = state(i+ii,j+jj,k+kk,n);
}
Expand All @@ -690,8 +690,8 @@ amrex_calc_alpha_limiter(int i, int j, int k, int n,
// Compute max and min values in a 3x2 stencil
for(int jj(-1); jj<=0; jj++){
for(int ii(-1); ii<=1; ii++){
if( flag(i,j,k).isConnected(ii,jj,kk) and
not (ii==0 and jj==0 and kk==0)) {
if ( flag(i,j,k).isConnected(ii,jj,kk) and
not (ii==0 and jj==0) ) {
if (state(i+ii,j+jj,k+kk,n) > q_max) q_max = state(i+ii,j+jj,k+kk,n);
if (state(i+ii,j+jj,k+kk,n) < q_min) q_min = state(i+ii,j+jj,k+kk,n);
}
Expand All @@ -711,10 +711,10 @@ amrex_calc_alpha_limiter(int i, int j, int k, int n,
amrex::Real q_min = state(i,j,k,n);
amrex::Real q_max = state(i,j,k,n);

for(int jj(0); jj<=1; jj++){
for(int jj(-1); jj<=1; jj++){
for(int ii(0); ii<=1; ii++){
if( flag(i,j,k).isConnected(ii,jj,kk) and
not (ii==0 and jj==0 and kk==0)) {
if ( flag(i,j,k).isConnected(ii,jj,kk) and
not (ii==0 and jj==0) ) {
if (state(i+ii,j+jj,k+kk,n) > q_max) q_max = state(i+ii,j+jj,k+kk,n);
if (state(i+ii,j+jj,k+kk,n) < q_min) q_min = state(i+ii,j+jj,k+kk,n);
}
Expand Down

0 comments on commit a2ad625

Please sign in to comment.