Skip to content

Commit

Permalink
fix how we tell which cell a particle is in
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren committed Jan 16, 2024
1 parent e0bd970 commit 750319a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/Particles/TracerPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@ TracerPC::AdvectWithUmac (Array<MultiFab const*, AMREX_SPACEDIM> 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

0 comments on commit 750319a

Please sign in to comment.