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
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);
58 int dir = (std::abs(nx) >= std::abs(ny)) ? 0 : 1;
59#if (AMREX_SPACEDIM == 2)
69 Real ymin = std::min(ym,yp);
70 Real ymax = std::max(ym,yp);
71 ymin = std::max(ymin,
Real(-0.5));
72 ymax = std::min(ymax,
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);
91 if (std::abs(nz) > std::abs(nx) && std::abs(nz) > std::abs(ny)) {
96 if (n1 == 0 && n2 == 0) {
100 }
else if (n2 == 0) {
104 Real ymin = std::min(ym,yp);
105 Real ymax = std::max(ym,yp);
106 ymin = std::max(ymin,
Real(-0.5));
107 ymax = std::min(ymax,
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;
119 ymin = std::max(ymin,
Real(-0.5));
120 ymax = std::min(ymax,
Real( 0.5));
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;
127 zmin = std::max(zmin,
Real(-0.5));
128 zmax = std::min(zmax,
Real( 0.5));
133 x = bc0 - ((
y-bc1)*n1+(
z-bc2)*n2)/n0;
139 if (std::abs(ny) >= std::abs(nz)) {
140 auto [
x,
y,
z] = f( nx, ny, nz,
144 auto [
x,
z,
y] = f( nx, nz, ny,
148 }
else if (dir == 1) {
149 if (std::abs(nx) >= std::abs(nz)) {
150 auto [
y,
x,
z] = f( ny, nx, nz,
154 auto [
y,
z,
x] = f( ny, nz, nx,
159 if (std::abs(nx) >= std::abs(ny)) {
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:172
#define AMREX_D_DECL(a, b, c)
Definition AMReX_SPACE.H:171
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:79
Definition AMReX_Amr.cpp:49
__host__ __device__ constexpr GpuTuple< detail::tuple_decay_t< Ts >... > makeTuple(Ts &&... args)
Definition AMReX_Tuple.H:263
Real Random()
Generate a psuedo-random double from uniform distribution.
Definition AMReX_Random.cpp:123
__host__ __device__ constexpr const T & min(const T &a, const T &b) noexcept
Definition AMReX_Algorithm.H:21
__host__ __device__ constexpr const T & max(const T &a, const T &b) noexcept
Definition AMReX_Algorithm.H:35
EBData_t
Definition AMReX_EBData.H:12
Definition AMReX_Array4.H:61
Definition AMReX_EBData.H:26
__host__ __device__ GpuArray< Real, 3 > randomPointOnEB(int i, int j, int k, RandomEngine const &engine) const
Definition AMReX_EBData.H:52
Array4< EBCellFlag const > const * m_cell_flag
Definition AMReX_EBData.H:174
static constexpr int real_data_size
Definition AMReX_EBData.H:172
Array4< Real const > const * m_real_data
Definition AMReX_EBData.H:175
__host__ __device__ auto get(int i, int j, int k, int n) const noexcept
Definition AMReX_EBData.H:45
__host__ __device__ auto get(int i, int j, int k) const noexcept
Definition AMReX_EBData.H:29
Fixed-size array that can be used on GPU.
Definition AMReX_Array.H:40
Definition AMReX_RandomEngine.H:72