1 #ifndef AMREX_EB_STATE_REDIST_SLOPE_LIMITER_K_H_
2 #define AMREX_EB_STATE_REDIST_SLOPE_LIMITER_K_H_
10 #ifdef AMREX_USE_FLOAT
11 constexpr Real epsilon = amrex::Real(1.e-6);
13 constexpr Real epsilon = 1.e-12;
19 if ((q_hat-state) > small) {
20 alpha =
amrex::min(1.0_rt,(q_max-state)/(q_hat-state));
21 }
else if ((q_hat-state) < -small) {
22 alpha =
amrex::min(1.0_rt,(q_min-state)/(q_hat-state));
37 #ifdef AMREX_USE_FLOAT
38 constexpr Real epsilon = amrex::Real(1.e-6);
40 constexpr Real epsilon = 1.e-12;
44 amrex::Real yalpha = 1.0;,
45 amrex::Real zalpha = 1.0;);
48 #if (AMREX_SPACEDIM == 2)
50 #elif (AMREX_SPACEDIM == 3)
51 for(
int kk(-1); kk<=1; kk++)
54 for(
int jj(-1); jj<=1; jj++){
55 for(
int ii(-1); ii<=1; ii++){
57 #if (AMREX_SPACEDIM == 3)
60 if (flag(i,j,k).isConnected(ii,jj,kk) && alpha > 0.0)
62 AMREX_D_TERM(Real delta_x = ccent(i+ii,j+jj,k+kk,0) - ccent(i,j,k,0) +
static_cast<Real
>(ii);,
63 Real delta_y = ccent(i+ii,j+jj,k+kk,1) - ccent(i,j,k,1) +
static_cast<Real
>(jj);,
64 Real delta_z = ccent(i+ii,j+jj,k+kk,2) - ccent(i,j,k,2) +
static_cast<Real
>(kk););
66 Real q_hat = state(i,j,k,n) +
AMREX_D_TERM( delta_x * slopes[0],
67 + delta_y * slopes[1],
68 + delta_z * slopes[2]);
70 Real q_max =
amrex::max(state(i+ii,j+jj,k+kk,n),state(i,j,k,n));
71 Real q_min =
amrex::min(state(i+ii,j+jj,k+kk,n),state(i,j,k,n));
79 #if (AMREX_SPACEDIM == 3)
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_DEVICE
Definition: AMReX_GpuQualifiers.H:18
#define AMREX_D_TERM(a, b, c)
Definition: AMReX_SPACE.H:129
#define AMREX_D_DECL(a, b, c)
Definition: AMReX_SPACE.H:104
Definition: AMReX_Amr.cpp:49
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > amrex_calc_centroid_limiter(int i, int j, int k, int n, amrex::Array4< amrex::Real const > const &state, amrex::Array4< amrex::EBCellFlag const > const &flag, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &slopes, amrex::Array4< amrex::Real const > const &ccent) noexcept
Definition: AMReX_EB_StateRedistSlopeLimiter_K.H:31
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & max(const T &a, const T &b) noexcept
Definition: AMReX_Algorithm.H:35
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & min(const T &a, const T &b) noexcept
Definition: AMReX_Algorithm.H:21
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T abs(const GpuComplex< T > &a_z) noexcept
Return the absolute value of a complex number.
Definition: AMReX_GpuComplex.H:356
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real amrex_calc_alpha_stencil(Real q_hat, Real q_max, Real q_min, Real state) noexcept
Definition: AMReX_EB_StateRedistSlopeLimiter_K.H:8
Definition: AMReX_Array4.H:61
Definition: AMReX_Array.H:34