Skip to content

Commit

Permalink
add amrex::
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Jun 20, 2023
1 parent 5bb0955 commit bbadefd
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 105 deletions.
90 changes: 45 additions & 45 deletions Src/EB/AMReX_EB_Slopes_2D_K.H
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ amrex_calc_slopes_eb_given_A (int i, int j, int /*k*/, int n,
! (ii==0 && jj==0)) {
du[ll] = state(i+ii,j+jj,0,n) - state(i,j,0,n);
} else {
du[ll] = Real(0.0);
du[ll] = amrex::Real(0.0);
}
ll++;
}
Expand All @@ -50,9 +50,9 @@ amrex_calc_slopes_eb_given_A (int i, int j, int /*k*/, int n,
for(int jj(0); jj<AMREX_SPACEDIM; ++jj)
{
for(int ii(0); ii<AMREX_SPACEDIM; ++ii){ // NOLINT(modernize-loop-convert)
AtA[jj][ii] = Real(0.0);
AtA[jj][ii] = amrex::Real(0.0);
}
Atb[jj] = Real(0.0);
Atb[jj] = amrex::Real(0.0);
}

for(int lc(0); lc<dim_a; ++lc)
Expand Down Expand Up @@ -115,9 +115,9 @@ amrex_calc_slopes_eb_given_A_grown (int i, int j, int /*k*/, int n, int nx, int
for(int jj(0); jj<AMREX_SPACEDIM; ++jj)
{
for(int ii(0); ii<AMREX_SPACEDIM; ++ii){ // NOLINT(modernize-loop-convert)
AtA[jj][ii] = Real(0.0);
AtA[jj][ii] = amrex::Real(0.0);
}
Atb[jj] = Real(0.0);
Atb[jj] = amrex::Real(0.0);
}

amrex::Real du;
Expand Down Expand Up @@ -256,13 +256,13 @@ amrex_calc_slopes_eb (int i, int j, int k, int n,
// slope is stored. Also not including the global shift
// wrt plo or i,j,k. We only need relative distance.

A[lc][0] = Real(ii) + ccent(i+ii,j+jj,k+kk,0) - ccent(i,j,k,0);
A[lc][1] = Real(jj) + ccent(i+ii,j+jj,k+kk,1) - ccent(i,j,k,1);
A[lc][0] = amrex::Real(ii) + ccent(i+ii,j+jj,k+kk,0) - ccent(i,j,k,0);
A[lc][1] = amrex::Real(jj) + ccent(i+ii,j+jj,k+kk,1) - ccent(i,j,k,1);

} else {

A[lc][0] = Real(0.0);
A[lc][1] = Real(0.0);
A[lc][0] = amrex::Real(0.0);
A[lc][1] = amrex::Real(0.0);
}
lc++;
}
Expand Down Expand Up @@ -312,8 +312,8 @@ amrex_calc_slopes_eb_grown (int i, int j, int k, int n, int nx, int ny,
int lc=0;
for(int jj(-2); jj<=2; jj++){
for(int ii(-2); ii<=2; ii++){
A[lc][0] = Real(0.0);
A[lc][1] = Real(0.0);
A[lc][0] = amrex::Real(0.0);
A[lc][1] = amrex::Real(0.0);
lc++;
}
}
Expand All @@ -324,8 +324,8 @@ amrex_calc_slopes_eb_grown (int i, int j, int k, int n, int nx, int ny,

if(!flag(i+ii,j+jj,k+kk).isCovered() && !(ii==0 && jj==0 && kk==0))
{
A[lc][0] = Real(ii) + ccent(i+ii,j+jj,k+kk,0) - ccent(i,j,k,0);
A[lc][1] = Real(jj) + ccent(i+ii,j+jj,k+kk,1) - ccent(i,j,k,1);
A[lc][0] = amrex::Real(ii) + ccent(i+ii,j+jj,k+kk,0) - ccent(i,j,k,0);
A[lc][1] = amrex::Real(jj) + ccent(i+ii,j+jj,k+kk,1) - ccent(i,j,k,1);
}
lc++;
}
Expand Down Expand Up @@ -424,8 +424,8 @@ amrex_calc_slopes_extdir_eb (int i, int j, int k, int n,
{
constexpr int dim_a = 9;

auto xslope = Real(0.0);
auto yslope = Real(0.0);
auto xslope = amrex::Real(0.0);
auto yslope = amrex::Real(0.0);

// First get EB-aware slope that doesn't know about extdir
bool needs_bdry_stencil = (edlo_x && i <= domlo_x) || (edhi_x && i >= domhi_x) ||
Expand Down Expand Up @@ -465,49 +465,49 @@ amrex_calc_slopes_extdir_eb (int i, int j, int k, int n,
bool khi_test = false;

// These are the default values if no physical boundary
A[lc][0] = Real(ii) + ccent(i+ii,j+jj,k+kk,0);
A[lc][1] = Real(jj) + ccent(i+ii,j+jj,k+kk,1);
A[lc][0] = amrex::Real(ii) + ccent(i+ii,j+jj,k+kk,0);
A[lc][1] = amrex::Real(jj) + ccent(i+ii,j+jj,k+kk,1);
// Do corrections for entire x-face
if (ilo_test)
{
if (!jlo_test && !jhi_test && !klo_test && !khi_test)
{
A[lc][1] = Real(jj) + fcx(i ,j+jj,k+kk,0);
A[lc][1] = amrex::Real(jj) + fcx(i ,j+jj,k+kk,0);
}
A[lc][0] = Real(-0.5) ;
A[lc][0] = amrex::Real(-0.5) ;
} else if (ihi_test) {

if (!jlo_test && !jhi_test && !klo_test && !khi_test)
{
A[lc][1] = Real(jj) + fcx(i+ii,j+jj,k+kk,0);
A[lc][1] = amrex::Real(jj) + fcx(i+ii,j+jj,k+kk,0);
}
A[lc][0] = Real(0.5) ;
A[lc][0] = amrex::Real(0.5) ;
}

// Do corrections for entire y-face
if (jlo_test)
{
if (!ilo_test && !ihi_test && !klo_test && !khi_test)
{
A[lc][0] = Real(ii) + fcy(i+ii,j ,k+kk,0);
A[lc][0] = amrex::Real(ii) + fcy(i+ii,j ,k+kk,0);
}
A[lc][1] = Real(-0.5) ;
A[lc][1] = amrex::Real(-0.5) ;

} else if (jhi_test) {

if (!ilo_test && !ihi_test && !klo_test && !khi_test)
{
A[lc][0] = Real(ii) + fcy(i+ii,j+jj,k+kk,0);
A[lc][0] = amrex::Real(ii) + fcy(i+ii,j+jj,k+kk,0);
}
A[lc][1] = Real(0.5) ;
A[lc][1] = amrex::Real(0.5) ;
}

A[lc][0] -= ccent(i,j,k,0);
A[lc][1] -= ccent(i,j,k,1);

} else {
A[lc][0] = Real(0.0);
A[lc][1] = Real(0.0);
A[lc][0] = amrex::Real(0.0);
A[lc][1] = amrex::Real(0.0);
}
lc++;
} // i,j
Expand Down Expand Up @@ -558,8 +558,8 @@ amrex_calc_slopes_extdir_eb_grown (int i, int j, int k, int n, int nx, int ny,
{
constexpr int dim_a = 25;

auto xslope = Real(0.0);
auto yslope = Real(0.0);
auto xslope = amrex::Real(0.0);
auto yslope = amrex::Real(0.0);

// First get EB-aware slope that doesn't know about extdir
bool needs_bdry_stencil = (edlo_x && i <= domlo_x) || (edhi_x && i >= domhi_x) ||
Expand Down Expand Up @@ -598,49 +598,49 @@ amrex_calc_slopes_extdir_eb_grown (int i, int j, int k, int n, int nx, int ny,
bool khi_test = false;

// These are the default values if no physical boundary
A[lc][0] = Real(ii) + ccent(i+ii,j+jj,k+kk,0);
A[lc][1] = Real(jj) + ccent(i+ii,j+jj,k+kk,1);
A[lc][0] = amrex::Real(ii) + ccent(i+ii,j+jj,k+kk,0);
A[lc][1] = amrex::Real(jj) + ccent(i+ii,j+jj,k+kk,1);
// Do corrections for entire x-face
if (ilo_test)
{
if (!jlo_test && !jhi_test && !klo_test && !khi_test)
{
A[lc][1] = Real(jj) + fcx(i ,j+jj,k+kk,0);
A[lc][1] = amrex::Real(jj) + fcx(i ,j+jj,k+kk,0);
}
A[lc][0] = Real(-0.5) ;
A[lc][0] = amrex::Real(-0.5) ;
} else if (ihi_test) {

if (!jlo_test && !jhi_test && !klo_test && !khi_test)
{
A[lc][1] = Real(jj) + fcx(i+ii,j+jj,k+kk,0);
A[lc][1] = amrex::Real(jj) + fcx(i+ii,j+jj,k+kk,0);
}
A[lc][0] = Real(0.5) ;
A[lc][0] = amrex::Real(0.5) ;
}

// Do corrections for entire y-face
if (jlo_test)
{
if (!ilo_test && !ihi_test && !klo_test && !khi_test)
{
A[lc][0] = Real(ii) + fcy(i+ii,j ,k+kk,0);
A[lc][0] = amrex::Real(ii) + fcy(i+ii,j ,k+kk,0);
}
A[lc][1] = Real(-0.5) ;
A[lc][1] = amrex::Real(-0.5) ;

} else if (jhi_test) {

if (!ilo_test && !ihi_test && !klo_test && !khi_test)
{
A[lc][0] = Real(ii) + fcy(i+ii,j+jj,k+kk,0);
A[lc][0] = amrex::Real(ii) + fcy(i+ii,j+jj,k+kk,0);
}
A[lc][1] = Real(0.5) ;
A[lc][1] = amrex::Real(0.5) ;
}

A[lc][0] -= ccent(i,j,k,0);
A[lc][1] -= ccent(i,j,k,1);

} else {
A[lc][0] = Real(0.0);
A[lc][1] = Real(0.0);
A[lc][0] = amrex::Real(0.0);
A[lc][1] = amrex::Real(0.0);
}
lc++;
} // i,j
Expand Down Expand Up @@ -723,7 +723,7 @@ amrex_calc_alpha_limiter(int i, int j, int k, int n,
amrex::Real xf = fcy(i,j+1,k,0); // local (x,z) of centroid of y-face we are extrapolating to

amrex::Real delta_x = xf - xc;
amrex::Real delta_y = Real(0.5) - yc;
amrex::Real delta_y = amrex::Real(0.5) - yc;

amrex::Real q_hat = state(i,j,k,n) + delta_x * slopes[0] + delta_y * slopes[1];

Expand All @@ -746,7 +746,7 @@ amrex_calc_alpha_limiter(int i, int j, int k, int n,
amrex::Real xf = fcy(i,j,k,0); // local (x,z) of centroid of y-face we are extrapolating to

amrex::Real delta_x = xf - xc;
amrex::Real delta_y = Real(0.5) + yc;
amrex::Real delta_y = amrex::Real(0.5) + yc;

amrex::Real q_hat = state(i,j,k,n) + delta_x * slopes[0] - delta_y * slopes[1];

Expand All @@ -768,7 +768,7 @@ amrex_calc_alpha_limiter(int i, int j, int k, int n,
if(flag(i,j,k).isConnected(1,0,0)) {
amrex::Real yf = fcx(i+1,j,k,0); // local (y,z) of centroid of x-face we are extrapolating to

amrex::Real delta_x = Real(0.5) - xc;
amrex::Real delta_x = amrex::Real(0.5) - xc;
amrex::Real delta_y = yf - yc;

amrex::Real q_hat = state(i,j,k,n) + delta_x * slopes[0] + delta_y * slopes[1];
Expand All @@ -790,7 +790,7 @@ amrex_calc_alpha_limiter(int i, int j, int k, int n,
if(flag(i,j,k).isConnected(-1,0,0)) {
amrex::Real yf = fcx(i,j,k,0); // local (y,z) of centroid of x-face we are extrapolating to

amrex::Real delta_x = Real(0.5) + xc;
amrex::Real delta_x = amrex::Real(0.5) + xc;
amrex::Real delta_y = yf - yc;

amrex::Real q_hat = state(i,j,k,n) - delta_x * slopes[0] + delta_y * slopes[1];
Expand Down
Loading

0 comments on commit bbadefd

Please sign in to comment.