Skip to content

Commit

Permalink
forgot to fix the other particle advection routine
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren committed Jan 16, 2024
1 parent 865720d commit daf595f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Source/Particles/ERFPCEvolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,16 @@ void ERFPC::AdvectWithGravity ( int a_lev,
iv[1] += domain.smallEnd()[1];
ParticleReal zlo, zhi;
if (use_terrain) {
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));
Real lx = (p.pos(0)-plo[0])*dxi[0] - static_cast<Real>(iv[0]-domain.smallEnd()[0]);
Real ly = (p.pos(1)-plo[1])*dxi[1] - static_cast<Real>(iv[1]-domain.smallEnd()[1]);
zlo = zheight(iv[0] ,iv[1] ,iv[2] ) * (1.0-lx) * (1.0-ly) +
zheight(iv[0]+1,iv[1] ,iv[2] ) * lx * (1.0-ly) +
zheight(iv[0] ,iv[1]+1,iv[2] ) * (1.0-lx) * ly +
zheight(iv[0]+1,iv[1]+1,iv[2] ) * lx * ly;
zhi = zheight(iv[0] ,iv[1] ,iv[2]+1) * (1.0-lx) * (1.0-ly) +
zheight(iv[0]+1,iv[1] ,iv[2]+1) * lx * (1.0-ly) +
zheight(iv[0] ,iv[1]+1,iv[2]+1) * (1.0-lx) * ly +
zheight(iv[0]+1,iv[1]+1,iv[2]+1) * lx * ly;
} else {
zlo = iv[2] * dx[2];
zhi = (iv[2]+1) * dx[2];
Expand Down

0 comments on commit daf595f

Please sign in to comment.