diff options
author | 2020-01-27 13:51:10 -0800 | |
---|---|---|
committer | 2020-01-27 13:51:10 -0800 | |
commit | 658c6888a1cf1de2828a187d6d051a6bc5a2f4cb (patch) | |
tree | 152f9a2db1ad6f3f02fed0b44b1cc7771d6b3621 /Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H | |
parent | f418ee4d2757364d2b666aad26bac94548f30f83 (diff) | |
download | WarpX-658c6888a1cf1de2828a187d6d051a6bc5a2f4cb.tar.gz WarpX-658c6888a1cf1de2828a187d6d051a6bc5a2f4cb.tar.zst WarpX-658c6888a1cf1de2828a187d6d051a6bc5a2f4cb.zip |
Fix compilation errors
Diffstat (limited to 'Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H')
-rw-r--r-- | Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H index 9258fdff4..5d160d865 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H +++ b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H @@ -19,6 +19,21 @@ struct CylindricalYeeAlgorithm { stencil_coefs_z[0] = 1./cell_size[2]; // 1./dz } + /** Applies the differential operator `1/r * d(rF)/dr`, + * where `F` is on a *nodal* grid in `r` + * and the differential operator is evaluated on *cell-centered* grid. + * The input parameter `r` is given at the cell-centered position*/ + AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE + static amrex::Real UpwardDrr_over_r( + amrex::Array4<amrex::Real> const& F, + amrex::Real const r, int const dr, + amrex::Real const* coefs_r, int const n_coefs_r, + int const i, int const j, int const k, int const comp ) { + + amrex::Real inv_dr = coefs_r[0]; + return inv_dr*( (r+0.5*dr)*F(i+1,j,k,comp) - (r-0.5*dr)*F(i,j,k,comp) ); + }; + AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE static amrex::Real UpwardDr( amrex::Array4<amrex::Real> const& F, |