Skip to content

Commit

Permalink
update how we locate which cell the particle is in (#1382)
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren authored Jan 16, 2024
1 parent b7512bc commit 0b43210
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Source/Particles/ERFPCEvolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ void ERFPC::AdvectWithFlow ( MultiFab* a_umac,
iv[1] += domain.smallEnd()[1];
ParticleReal zlo, zhi;
if (use_terrain) {
zlo = zheight(iv[0], iv[1], iv[2]);
zhi = zheight(iv[0], iv[1], iv[2]+1);
zlo = Real(0.25) * (zheight(iv[0],iv[1] ,iv[2] ) + zheight(iv[0]+1,iv[1] ,iv[2] ) +
zheight(iv[0],iv[1]+1,iv[2] ) + zheight(iv[0]+1,iv[1]+1,iv[2] ));
zhi = Real(0.25) * (zheight(iv[0],iv[1] ,iv[2]+1) + zheight(iv[0]+1,iv[1] ,iv[2]+1) +
zheight(iv[0],iv[1]+1,iv[2]+1) + zheight(iv[0]+1,iv[1]+1,iv[2]+1));
} else {
zlo = iv[2] * dx[2];
zhi = (iv[2]+1) * dx[2];
Expand Down Expand Up @@ -224,8 +226,10 @@ void ERFPC::AdvectWithGravity ( int a_lev,
iv[1] += domain.smallEnd()[1];
ParticleReal zlo, zhi;
if (use_terrain) {
zlo = zheight(iv[0], iv[1], iv[2]);
zhi = zheight(iv[0], iv[1], iv[2]+1);
zlo = Real(0.25) * (zheight(iv[0],iv[1] ,iv[2] ) + zheight(iv[0]+1,iv[1] ,iv[2] ) +
zheight(iv[0],iv[1]+1,iv[2] ) + zheight(iv[0]+1,iv[1]+1,iv[2] ));
zhi = Real(0.25) * (zheight(iv[0],iv[1] ,iv[2]+1) + zheight(iv[0]+1,iv[1] ,iv[2]+1) +
zheight(iv[0],iv[1]+1,iv[2]+1) + zheight(iv[0]+1,iv[1]+1,iv[2]+1));
} else {
zlo = iv[2] * dx[2];
zhi = (iv[2]+1) * dx[2];
Expand Down

0 comments on commit 0b43210

Please sign in to comment.