From a62864545da98f5398eeb7c430dba372e3437635 Mon Sep 17 00:00:00 2001 From: Ann Almgren Date: Sat, 23 Nov 2024 14:50:10 -0800 Subject: [PATCH] remove unused --- Source/LinearSolvers/ERF_TerrainPoisson.cpp | 2 +- .../LinearSolvers/ERF_TerrainPoisson_3D_K.H | 41 +++++++------------ 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/Source/LinearSolvers/ERF_TerrainPoisson.cpp b/Source/LinearSolvers/ERF_TerrainPoisson.cpp index 3f14a081e..07128f309 100644 --- a/Source/LinearSolvers/ERF_TerrainPoisson.cpp +++ b/Source/LinearSolvers/ERF_TerrainPoisson.cpp @@ -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]); }); } diff --git a/Source/LinearSolvers/ERF_TerrainPoisson_3D_K.H b/Source/LinearSolvers/ERF_TerrainPoisson_3D_K.H index 3fe586acf..707860d02 100644 --- a/Source/LinearSolvers/ERF_TerrainPoisson_3D_K.H +++ b/Source/LinearSolvers/ERF_TerrainPoisson_3D_K.H @@ -157,7 +157,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void terrpoisson_adotx (int i, int j, int k, amrex::Array4 const& y, amrex::Array4 const& x, amrex::Array4 const& zp, - T dxinv, T dyinv, T dzinv) noexcept + T dxinv, T dyinv) noexcept { using amrex::Real; Real h_xi, h_eta, h_zeta; @@ -334,21 +334,6 @@ void terrpoisson_adotx (int i, int j, int k, amrex::Array4 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 @@ -361,19 +346,21 @@ void terrpoisson_adotx (int i, int j, int k, amrex::Array4 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