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,
32 using namespace amrex::literals;
34 stencil_coefs_r.resize(1);
35 stencil_coefs_r[0] = 1._rt/cell_size[0];
44 using namespace amrex::literals;
46 const amrex::Real delta_t = 0.78_rt * dx[0] /
PhysConst::c;
65 amrex::Real
const r, amrex::Real
const dr,
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 ) {
69 using namespace amrex::literals;
72 amrex::Real
const inv_dr = coefs_r[0];
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) );
83 amrex::Real
const r, amrex::Real
const dr,
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 ) {
87 using namespace amrex::literals;
90 amrex::Real
const inv_dr = coefs_r[0];
91 amrex::Real
const rph = r + 0.5_rt*dr;
92 amrex::Real
const rmh = r - 0.5_rt*dr;
93 return 1._rt/(r*r) * inv_dr*( rph*rph*F(i,j,k,comp) - rmh*rmh*F(i-1,j,k,comp) );
103 amrex::Real
const r, amrex::Real
const dr,
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 ) {
107 using namespace amrex::literals;
110 amrex::Real
const inv_dr = coefs_r[0];
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 ) {
124 amrex::Real
const inv_dr = coefs_r[0];
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 ) {
138 amrex::Real
const inv_dr = coefs_r[0];
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:149
__host__ __device__ void ignore_unused(const Ts &...)
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