diff options
author | 2020-01-13 08:46:38 -0800 | |
---|---|---|
committer | 2020-01-13 11:44:06 -0800 | |
commit | c55c6188ea2dafdc72764fabb35f01d0431f12ce (patch) | |
tree | a475bb3c782cdd503ac927784ebefcfb491871d9 /Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms | |
parent | 6166de191d0a2b468ea56bacec481e1ff27fcae1 (diff) | |
download | WarpX-c55c6188ea2dafdc72764fabb35f01d0431f12ce.tar.gz WarpX-c55c6188ea2dafdc72764fabb35f01d0431f12ce.tar.zst WarpX-c55c6188ea2dafdc72764fabb35f01d0431f12ce.zip |
Correct compilation errors
Diffstat (limited to 'Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms')
-rw-r--r-- | Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/YeeAlgorithm.H | 52 |
1 files changed, 33 insertions, 19 deletions
diff --git a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/YeeAlgorithm.H b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/YeeAlgorithm.H index 7e32aebb4..54057091d 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/YeeAlgorithm.H +++ b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/YeeAlgorithm.H @@ -8,10 +8,10 @@ struct YeeAlgorithm { static void InitializeStencilCoefficients( - std::array<amrex::Real,3> cell_size, - amrex::Gpu::ManagedVector<amrex::Real> stencil_coefs_x, - amrex::Gpu::ManagedVector<amrex::Real> stencil_coefs_y, - amrex::Gpu::ManagedVector<amrex::Real> stencil_coefs_z ) { + std::array<amrex::Real,3>& cell_size, + amrex::Gpu::ManagedVector<amrex::Real>& stencil_coefs_x, + amrex::Gpu::ManagedVector<amrex::Real>& stencil_coefs_y, + amrex::Gpu::ManagedVector<amrex::Real>& stencil_coefs_z ) { // Store the inverse cell size along each direction in the coefficients stencil_coefs_x.resize(1); @@ -24,9 +24,9 @@ struct YeeAlgorithm { AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE static amrex::Real UpwardDx( - amrex::Array4<amrex::Real> const F, - int const i, int const j, int const k, - amrex::Real const* coefs_x, int const n_coefs_x ) { + amrex::Array4<amrex::Real> const& F, + amrex::Real const* coefs_x, int const n_coefs_x, + int const i, int const j, int const k ) { amrex::Real inv_dx = coefs_x[0]; return inv_dx*( F(i+1,j,k) - F(i,j,k) ); @@ -34,9 +34,9 @@ struct YeeAlgorithm { AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE static amrex::Real DownwardDx( - amrex::Array4<amrex::Real> const F, - int const i, int const j, int const k, - amrex::Real const* coefs_x, int const n_coefs_x ) { + amrex::Array4<amrex::Real> const& F, + amrex::Real const* coefs_x, int const n_coefs_x, + int const i, int const j, int const k ) { amrex::Real inv_dx = coefs_x[0]; return inv_dx*( F(i,j,k) - F(i-1,j,k) ); @@ -44,9 +44,9 @@ struct YeeAlgorithm { AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE static amrex::Real UpwardDy( - amrex::Array4<amrex::Real> const F, - int const i, int const j, int const k, - amrex::Real const* coefs_y, int const n_coefs_y ) { + amrex::Array4<amrex::Real> const& F, + amrex::Real const* coefs_y, int const n_coefs_y, + int const i, int const j, int const k ) { #if defined WARPX_DIM_3D amrex::Real inv_dy = coefs_y[0]; @@ -58,9 +58,9 @@ struct YeeAlgorithm { AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE static amrex::Real DownwardDy( - amrex::Array4<amrex::Real> const F, - int const i, int const j, int const k, - amrex::Real const* coefs_y, int const n_coefs_y ) { + amrex::Array4<amrex::Real> const& F, + amrex::Real const* coefs_y, int const n_coefs_y, + int const i, int const j, int const k ) { #if defined WARPX_DIM_3D amrex::Real inv_dy = coefs_y[0]; @@ -72,9 +72,9 @@ struct YeeAlgorithm { AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE static amrex::Real UpwardDz( - amrex::Array4<amrex::Real> const F, - int const i, int const j, int const k, - amrex::Real const* coefs_z, int const n_coefs_z ) { + amrex::Array4<amrex::Real> const& F, + amrex::Real const* coefs_z, int const n_coefs_z, + int const i, int const j, int const k ) { amrex::Real inv_dz = coefs_z[0]; #if defined WARPX_DIM_3D @@ -84,6 +84,20 @@ struct YeeAlgorithm { #endif }; + AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE + static amrex::Real DownwardDz( + amrex::Array4<amrex::Real> const& F, + amrex::Real const* coefs_z, int const n_coefs_z, + int const i, int const j, int const k ) { + + amrex::Real inv_dz = coefs_z[0]; + #if defined WARPX_DIM_3D + return inv_dz*( F(i,j,k) - F(i,j,k-1) ); + #elif (defined WARPX_DIM_XZ) + return inv_dz*( F(i,j,k) - F(i,j-1,k) ); + #endif + }; + }; #endif // WARPX_FINITE_DIFFERENCE_ALGORITHM_YEE_H_ |