1 #ifndef AMREX_EB_DATA_H_
2 #define AMREX_EB_DATA_H_
3 #include <AMReX_Config.H>
29 auto get (
int i,
int j,
int k)
const noexcept
43 || T==EBData_t::fcz),
int> = 0>
45 auto get (
int i,
int j,
int k,
int n)
const noexcept
54 Real nx = this->get<EBData_t::bndrynorm>(i,j,k,0);
55 Real ny = this->get<EBData_t::bndrynorm>(i,j,k,1);
56 Real bcx = this->get<EBData_t::bndrycent>(i,j,k,0);
57 Real bcy = this->get<EBData_t::bndrycent>(i,j,k,1);
59 #if (AMREX_SPACEDIM == 2)
60 auto f = [&] (Real n0, Real n1, Real bc0, Real bc1)
67 Real ym = bc1+nn*(bc0-Real(-0.5));
68 Real yp = bc1+nn*(bc0-Real( 0.5));
73 Real y = rn/(ymax-ymin) + ymin;
74 Real
x = bc0 - (y-bc1)*n1/n0;
80 auto [
x,y] =
f( nx, ny,
84 auto [y,
x] =
f( ny, nx,
89 Real nz = this->get<EBData_t::bndrynorm>(i,j,k,2);
90 Real bcz = this->get<EBData_t::bndrycent>(i,j,k,2);
94 auto f = [&] (Real n0, Real n1, Real n2, Real bc0, Real bc1, Real bc2)
96 if (n1 == 0 && n2 == 0) {
100 }
else if (n2 == 0) {
102 Real ym = bc1+nn*(bc0-Real(-0.5));
103 Real yp = bc1+nn*(bc0-Real( 0.5));
110 Real
x = bc0 - ((y-bc1)*n1+(z-bc2)*n2)/n0;
113 Real y0 = bc1 - ((Real(-0.5)-bc0)*n0+(Real(-0.5)-bc2)*n2)/n1;
114 Real y1 = bc1 - ((Real( 0.5)-bc0)*n0+(Real(-0.5)-bc2)*n2)/n1;
115 Real y2 = bc1 - ((Real(-0.5)-bc0)*n0+(Real( 0.5)-bc2)*n2)/n1;
116 Real y3 = bc1 - ((Real( 0.5)-bc0)*n0+(Real( 0.5)-bc2)*n2)/n1;
117 Real ymin =
std::min({y0,y1,y2,y3});
118 Real ymax =
std::max({y0,y1,y2,y3});
121 Real z0 = bc2 - ((Real(-0.5)-bc0)*n0+(Real(-0.5)-bc1)*n1)/n2;
122 Real z1 = bc2 - ((Real( 0.5)-bc0)*n0+(Real(-0.5)-bc1)*n1)/n2;
123 Real z2 = bc2 - ((Real(-0.5)-bc0)*n0+(Real( 0.5)-bc1)*n1)/n2;
124 Real z3 = bc2 - ((Real( 0.5)-bc0)*n0+(Real( 0.5)-bc1)*n1)/n2;
125 Real zmin =
std::min({z0,z1,z2,z3});
126 Real zmax =
std::max({z0,z1,z2,z3});
133 x = bc0 - ((y-bc1)*n1+(z-bc2)*n2)/n0;
134 }
while (
x > Real(0.5) ||
x < Real(-0.5));
140 auto [
x,y,z] =
f( nx, ny, nz,
144 auto [
x,z,y] =
f( nx, nz, ny,
148 }
else if (dir == 1) {
150 auto [y,
x,z] =
f( ny, nx, nz,
154 auto [y,z,
x] =
f( ny, nz, nx,
160 auto [z,
x,y] =
f( nz, nx, ny,
164 auto [z,y,
x] =
f( nz, ny, nx,
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
#define AMREX_D_TERM(a, b, c)
Definition: AMReX_SPACE.H:129
static int f(amrex::Real t, N_Vector y_data, N_Vector y_rhs, void *user_data)
Definition: AMReX_SundialsIntegrator.H:44
@ min
Definition: AMReX_ParallelReduce.H:18
@ max
Definition: AMReX_ParallelReduce.H:17
Definition: AMReX_Amr.cpp:49
Real Random()
Generate a psuedo-random double from uniform distribution.
Definition: AMReX_Random.cpp:123
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
constexpr AMREX_GPU_HOST_DEVICE GpuTuple< detail::tuple_decay_t< Ts >... > makeTuple(Ts &&... args)
Definition: AMReX_Tuple.H:252
const int[]
Definition: AMReX_BLProfiler.cpp:1664
EBData_t
Definition: AMReX_EBData.H:12
Definition: AMReX_Array4.H:61
Definition: AMReX_EBData.H:26
Array4< EBCellFlag const > const * m_cell_flag
Definition: AMReX_EBData.H:174
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuArray< Real, AMREX_SPACEDIM > randomPointOnEB(int i, int j, int k, RandomEngine const &engine) const
Definition: AMReX_EBData.H:52
static constexpr int real_data_size
Definition: AMReX_EBData.H:172
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto get(int i, int j, int k) const noexcept
Definition: AMReX_EBData.H:29
Array4< Real const > const * m_real_data
Definition: AMReX_EBData.H:175
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto get(int i, int j, int k, int n) const noexcept
Definition: AMReX_EBData.H:45
Definition: AMReX_RandomEngine.H:57