Skip to content

Commit

Permalink
remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren committed Nov 23, 2024
1 parent 60426f3 commit a628645
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Source/LinearSolvers/ERF_TerrainPoisson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void TerrainPoisson::apply(MultiFab& lhs, MultiFab const& rhs)
auto const& xc = xx.const_arrays();
ParallelFor(rhs, [=] AMREX_GPU_DEVICE (int b, int i, int j, int k)
{
terrpoisson_adotx(i,j,k,y[b], xc[b], zpa[b], dxinv[0], dxinv[1], dxinv[2]);
terrpoisson_adotx(i,j,k,y[b], xc[b], zpa[b], dxinv[0], dxinv[1]);
});
}

Expand Down
41 changes: 14 additions & 27 deletions Source/LinearSolvers/ERF_TerrainPoisson_3D_K.H
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void terrpoisson_adotx (int i, int j, int k, amrex::Array4<T> const& y,
amrex::Array4<T const> const& x,
amrex::Array4<T const> const& zp,
T dxinv, T dyinv, T dzinv) noexcept
T dxinv, T dyinv) noexcept
{
using amrex::Real;
Real h_xi, h_eta, h_zeta;
Expand Down Expand Up @@ -334,21 +334,6 @@ void terrpoisson_adotx (int i, int j, int k, amrex::Array4<T> const& y,
pz_lo -= 0.5 * h_xi_on_zlo * ( (px_hi_md_lo + px_lo_md_lo) - (pz_hi_md_lo + pz_lo_md_lo) );
pz_lo -= 0.5 * h_eta_on_zlo * ( (py_md_hi_lo + py_md_lo_lo) - (pz_md_hi_lo + pz_md_lo_lo) );

// *********************************************************
// Adotx
// *********************************************************
Real dzinv_ccent = 4.0 / ( (zp(i,j,k+1) + zp(i+1,j,k+1) + zp(i,j+1,k+1) + zp(i+1,j+1,k+1))
-(zp(i,j,k ) + zp(i+1,j,k ) + zp(i,j+1,k ) + zp(i+1,j+1,k )) );

Real ax_lo = .5 * (zp(i ,j,k+1) + zp(i ,j+1,k+1) - zp(i ,j,k) - zp(i ,j+1,k));
Real ax_hi = .5 * (zp(i+1,j,k+1) + zp(i+1,j+1,k+1) - zp(i+1,j,k) - zp(i+1,j+1,k));
Real ay_lo = .5 * (zp(i,j ,k+1) + zp(i+1,j ,k+1) - zp(i,j ,k) - zp(i+1,j ,k));
Real ay_hi = .5 * (zp(i,j+1,k+1) + zp(i+1,j+1,k+1) - zp(i,j+1,k) - zp(i+1,j+1,k));

y(i,j,k) = ( (ax_hi*px_hi - ax_lo*px_lo) * dxinv
+(ay_hi*py_hi - ay_lo*py_lo) * dyinv
+ (pz_hi - pz_lo) ) * dzinv_ccent;

#else
//
// This option uses calls to the flux routines so there is
Expand All @@ -361,19 +346,21 @@ void terrpoisson_adotx (int i, int j, int k, amrex::Array4<T> const& y,
Real py_hi = -terrpoisson_flux_y(i,j+1,k,x,zp,dyinv);
Real pz_lo = -terrpoisson_flux_z(i,j,k ,x,zp,dxinv,dyinv);
Real pz_hi = -terrpoisson_flux_z(i,j,k+1,x,zp,dxinv,dyinv);
#endif

Real ax_lo = .5 * (zp(i ,j,k+1) + zp(i ,j+1,k+1) - zp(i ,j,k) - zp(i ,j+1,k)) * dzinv;
Real ax_hi = .5 * (zp(i+1,j,k+1) + zp(i+1,j+1,k+1) - zp(i+1,j,k) - zp(i+1,j+1,k)) * dzinv;
Real ay_lo = .5 * (zp(i,j ,k+1) + zp(i+1,j ,k+1) - zp(i,j ,k) - zp(i+1,j ,k)) * dzinv;
Real ay_hi = .5 * (zp(i,j+1,k+1) + zp(i+1,j+1,k+1) - zp(i,j+1,k) - zp(i+1,j+1,k)) * dzinv;
// *********************************************************
// Adotx
// *********************************************************
Real invdJ = 4.0 / ( zp(i,j,k+1) + zp(i+1,j,k+1) + zp(i,j+1,k+1) + zp(i+1,j+1,k+1)
-zp(i,j,k ) - zp(i+1,j,k ) - zp(i,j+1,k ) - zp(i+1,j+1,k ) );

Real dJ = .25 * ( zp(i,j,k+1) + zp(i+1,j,k+1) + zp(i,j+1,k+1) + zp(i+1,j+1,k+1)
-zp(i,j,k ) - zp(i+1,j,k ) - zp(i,j+1,k ) - zp(i+1,j+1,k ) ) * dzinv;
Real ax_lo = .5 * (zp(i ,j,k+1) + zp(i ,j+1,k+1) - zp(i ,j,k) - zp(i ,j+1,k));
Real ax_hi = .5 * (zp(i+1,j,k+1) + zp(i+1,j+1,k+1) - zp(i+1,j,k) - zp(i+1,j+1,k));
Real ay_lo = .5 * (zp(i,j ,k+1) + zp(i+1,j ,k+1) - zp(i,j ,k) - zp(i+1,j ,k));
Real ay_hi = .5 * (zp(i,j+1,k+1) + zp(i+1,j+1,k+1) - zp(i,j+1,k) - zp(i+1,j+1,k));

y(i,j,k) = ( (ax_hi*px_hi - ax_lo*px_lo)* dxinv
+(ay_hi*py_hi - ay_lo*py_lo)* dyinv
+( pz_hi - pz_lo)* dzinv) / dJ;
#endif
y(i,j,k) = ( (ax_hi*px_hi - ax_lo*px_lo) * dxinv
+(ay_hi*py_hi - ay_lo*py_lo) * dyinv
+( pz_hi - pz_lo) ) * invdJ;
}

#endif

0 comments on commit a628645

Please sign in to comment.