Skip to content

Commit

Permalink
Cleanup part 4
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsexton03 committed Apr 30, 2024
1 parent e2bd893 commit a741cca
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions Src/EB/AMReX_EB2_3D_C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ void set_eb_data (const int i, const int j, const int k,
Array4<Real> const& bnorm, Real small_volfrac,
bool& is_small_cell, bool& is_multicut) noexcept
{
const Real axmt = apx(i ,j ,k )*dx[1]*dx[2];
const Real axpt = apx(i+1,j ,k )*dx[1]*dx[2];
const Real aymt = apy(i ,j ,k )*dx[0]*dx[2];
const Real aypt = apy(i ,j+1,k )*dx[0]*dx[2];
const Real azmt = apz(i ,j ,k )*dx[0]*dx[1];
const Real azpt = apz(i ,j ,k+1)*dx[0]*dx[1];
const Real axm = apx(i,j,k);
const Real axp = apx(i+1,j,k);
const Real aym = apy(i,j,k);
Expand All @@ -69,22 +63,22 @@ void set_eb_data (const int i, const int j, const int k,
// We know there are no multiple cuts on faces by now.
// We need to check the case that there are two cuts
// at the opposite corners.
bool multi_cuts = (axmt >= 0.5_rt*dx[1]*dx[2] && axmt < dx[1]*dx[2] &&
axpt >= 0.5_rt*dx[1]*dx[2] && axpt < dx[1]*dx[2] &&
aymt >= 0.5_rt*dx[0]*dx[1] && aymt < dx[0]*dx[1] &&
aypt >= 0.5_rt*dx[0]*dx[1] && aypt < dx[0]*dx[1] &&
azmt >= 0.5_rt*dx[1]*dx[2] && azmt < dx[1]*dx[2] &&
azpt >= 0.5_rt*dx[1]*dx[2] && azpt < dx[1]*dx[2]);
bool multi_cuts = (axm >= 0.5_rt && axm < 1.0_rt &&
axp >= 0.5_rt && axp < 1.0_rt &&
aym >= 0.5_rt && aym < 1.0_rt &&
ayp >= 0.5_rt && ayp < 1.0_rt &&
azm >= 0.5_rt && azm < 1.0_rt &&
azp >= 0.5_rt && azp < 1.0_rt);

if (multi_cuts) {
set_covered(i, j, k, cell, vfrac, vcent, barea, bcent, bnorm);
is_multicut = true;
return;
}

Real dapx = axmt - axpt;
Real dapy = aymt - aypt;
Real dapz = azmt - azpt;
Real dapx = (axm - axp)*(dx[1]*dx[2]);
Real dapy = (aym - ayp)*(dx[0]*dx[2]);
Real dapz = (azm - azp)*(dx[0]*dx[1]);
const Real apnorm = std::sqrt(dapx*dapx+dapy*dapy+dapz*dapz) + 1.e-30_rt*std::sqrt(dx[0]*dx[1]*dx[2]);
if (apnorm == 0.0_rt) {
bool maybe_multi_cuts = (axm == 0.0_rt && axp == 0.0_rt) ||
Expand All @@ -108,7 +102,7 @@ void set_eb_data (const int i, const int j, const int k,
bnorm(i,j,k,0) = nx;
bnorm(i,j,k,1) = ny;
bnorm(i,j,k,2) = nz;
barea(i,j,k) = (nx*dapx/dx[1]/dx[2] + ny*dapy/dx[0]/dx[2] + nz*dapz/dx[0]/dx[1]);
barea(i,j,k) = (nx*dapx/(dx[1]*dx[2]) + ny*dapy/(dx[0]*dx[2]) + nz*dapz/(dx[0]*dx[1]));

Real aax = 0.5_rt*(axm+axp);
Real aay = 0.5_rt*(aym+ayp);
Expand Down

0 comments on commit a741cca

Please sign in to comment.