8#ifndef WARPX_FINITE_DIFFERENCE_ALGORITHM_SPHERICAL_YEE_H_
9#define WARPX_FINITE_DIFFERENCE_ALGORITHM_SPHERICAL_YEE_H_
29 std::array<amrex::Real,3>& cell_size,
34 stencil_coefs_r.resize(1);
35 stencil_coefs_r[0] = 1._rt/cell_size[0];
66 amrex::Real const *
const coefs_r,
int const n_coefs_r,
67 int const i,
int const j,
int const k,
int const comp ) {
73 return 1._rt/r * inv_dr*( (r+0.5_rt*dr)*F(i+1,j,k,comp) - (r-0.5_rt*dr)*F(i,j,k,comp) );
84 amrex::Real const *
const coefs_r,
int const n_coefs_r,
85 int const i,
int const j,
int const k,
int const comp ) {
93 return 1._rt/(r*r) * inv_dr*( rph*rph*F(i,j,k,comp) - rmh*rmh*F(i-1,j,k,comp) );
104 amrex::Real const *
const coefs_r,
int const n_coefs_r,
105 int const i,
int const j,
int const k,
int const comp ) {
111 return 1._rt/r * inv_dr*( (r+0.5_rt*dr)*F(i,j,k,comp) - (r-0.5_rt*dr)*F(i-1,j,k,comp) );
119 amrex::Real const *
const coefs_r,
int const n_coefs_r,
120 int const i,
int const j,
int const k,
int const comp ) {
125 return inv_dr*( F(i+1,j,k,comp) - F(i,j,k,comp) );
133 amrex::Real const *
const coefs_r,
int const n_coefs_r,
134 int const i,
int const j,
int const k,
int const comp ) {
139 return inv_dr*( F(i,j,k,comp) - F(i-1,j,k,comp) );
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
#define AMREX_D_DECL(a, b, c)
constexpr auto c
vacuum speed of light [m/s]
Definition constant.H:153
__host__ __device__ void ignore_unused(const Ts &...)
ArrayND< T, 4, true > Array4
Definition SphericalYeeAlgorithm.H:26
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real UpwardDr(amrex::Array4< amrex::Real const > const &F, amrex::Real const *const coefs_r, int const n_coefs_r, int const i, int const j, int const k, int const comp)
Definition SphericalYeeAlgorithm.H:117
static amrex::Real ComputeMaxDt(amrex::Real const *const dx)
Definition SphericalYeeAlgorithm.H:43
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real DownwardDr(amrex::Array4< amrex::Real const > const &F, amrex::Real const *const coefs_r, int const n_coefs_r, int const i, int const j, int const k, int const comp)
Definition SphericalYeeAlgorithm.H:131
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real UpwardDrr_over_r(amrex::Array4< amrex::Real const > const &F, amrex::Real const r, amrex::Real const dr, amrex::Real const *const coefs_r, int const n_coefs_r, int const i, int const j, int const k, int const comp)
Definition SphericalYeeAlgorithm.H:63
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real DownwardDrr_over_r(amrex::Array4< amrex::Real const > const &F, amrex::Real const r, amrex::Real const dr, amrex::Real const *const coefs_r, int const n_coefs_r, int const i, int const j, int const k, int const comp)
Definition SphericalYeeAlgorithm.H:101
static amrex::IntVect GetMaxGuardCell()
Returns maximum number of guard cells required by the field-solve.
Definition SphericalYeeAlgorithm.H:53
static void InitializeStencilCoefficients(std::array< amrex::Real, 3 > &cell_size, amrex::Vector< amrex::Real > &stencil_coefs_r)
Definition SphericalYeeAlgorithm.H:28
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real DownwardDrr2_over_r2(amrex::Array4< amrex::Real const > const &F, amrex::Real const r, amrex::Real const dr, amrex::Real const *const coefs_r, int const n_coefs_r, int const i, int const j, int const k, int const comp)
Definition SphericalYeeAlgorithm.H:81