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
40 const auto&
get () const noexcept
56 auto get (
int i,
int j,
int k,
int n)
const noexcept
65 Real nx = this->get<EBData_t::bndrynorm>(i,j,k,0);
66 Real ny = this->get<EBData_t::bndrynorm>(i,j,k,1);
67 Real bcx = this->get<EBData_t::bndrycent>(i,j,k,0);
68 Real bcy = this->get<EBData_t::bndrycent>(i,j,k,1);
69 int dir = (std::abs(nx) >= std::abs(ny)) ? 0 : 1;
70#if (AMREX_SPACEDIM == 2)
80 Real ymin = std::min(ym,yp);
81 Real ymax = std::max(ym,yp);
82 ymin = std::max(ymin,
Real(-0.5));
83 ymax = std::min(ymax,
Real( 0.5));
84 Real y = rn*(ymax-ymin) + ymin;
85 Real x = bc0 - (
y-bc1)*n1/n0;
91 auto [
x,
y] = f( nx, ny,
95 auto [
y,
x] = f( ny, nx,
100 Real nz = this->get<EBData_t::bndrynorm>(i,j,k,2);
101 Real bcz = this->get<EBData_t::bndrycent>(i,j,k,2);
102 if (std::abs(nz) > std::abs(nx) && std::abs(nz) > std::abs(ny)) {
107 if (n1 == 0 && n2 == 0) {
111 }
else if (n2 == 0) {
115 Real ymin = std::min(ym,yp);
116 Real ymax = std::max(ym,yp);
117 ymin = std::max(ymin,
Real(-0.5));
118 ymax = std::min(ymax,
Real( 0.5));
121 Real x = bc0 - ((
y-bc1)*n1+(
z-bc2)*n2)/n0;
124 Real y0 = bc1 - ((
Real(-0.5)-bc0)*n0+(
Real(-0.5)-bc2)*n2)/n1;
125 Real y1 = bc1 - ((
Real( 0.5)-bc0)*n0+(
Real(-0.5)-bc2)*n2)/n1;
126 Real y2 = bc1 - ((
Real(-0.5)-bc0)*n0+(
Real( 0.5)-bc2)*n2)/n1;
127 Real y3 = bc1 - ((
Real( 0.5)-bc0)*n0+(
Real( 0.5)-bc2)*n2)/n1;
130 ymin = std::max(ymin,
Real(-0.5));
131 ymax = std::min(ymax,
Real( 0.5));
132 Real z0 = bc2 - ((
Real(-0.5)-bc0)*n0+(
Real(-0.5)-bc1)*n1)/n2;
133 Real z1 = bc2 - ((
Real( 0.5)-bc0)*n0+(
Real(-0.5)-bc1)*n1)/n2;
134 Real z2 = bc2 - ((
Real(-0.5)-bc0)*n0+(
Real( 0.5)-bc1)*n1)/n2;
135 Real z3 = bc2 - ((
Real( 0.5)-bc0)*n0+(
Real( 0.5)-bc1)*n1)/n2;
138 zmin = std::max(zmin,
Real(-0.5));
139 zmax = std::min(zmax,
Real( 0.5));
144 x = bc0 - ((
y-bc1)*n1+(
z-bc2)*n2)/n0;
150 if (std::abs(ny) >= std::abs(nz)) {
151 auto [
x,
y,
z] = f( nx, ny, nz,
155 auto [
x,
z,
y] = f( nx, nz, ny,
159 }
else if (dir == 1) {
160 if (std::abs(nx) >= std::abs(nz)) {
161 auto [
y,
x,
z] = f( ny, nx, nz,
165 auto [
y,
z,
x] = f( ny, nz, nx,
170 if (std::abs(nx) >= std::abs(ny)) {
171 auto [
z,
x,
y] = f( nz, nx, ny,
175 auto [
z,
y,
x] = f( nz, ny, nx,
191 template <EBData_t T>
193 auto get (
int box_no,
int i,
int j,
int k)
const noexcept
209 auto get (
int box_no,
int i,
int j,
int k,
int n)
const noexcept
#define AMREX_FORCE_INLINE
Definition AMReX_Extension.H:119
#define AMREX_RESTRICT
Definition AMReX_Extension.H:32
#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
Real Random()
Generate a psuedo-random real from uniform distribution.
Definition AMReX_Random.cpp:123
Definition AMReX_Amr.cpp:49
__host__ __device__ constexpr GpuTuple< detail::tuple_decay_t< Ts >... > makeTuple(Ts &&... args)
Definition AMReX_Tuple.H:263
__host__ __device__ constexpr const T & min(const T &a, const T &b) noexcept
Definition AMReX_Algorithm.H:24
__host__ __device__ constexpr const T & max(const T &a, const T &b) noexcept
Definition AMReX_Algorithm.H:44
EBData_t
Definition AMReX_EBData.H:12
A multidimensional array accessor.
Definition AMReX_Array4.H:283
Definition AMReX_EBData.H:190
Array4< Real const > const *__restrict__ m_real_data
Definition AMReX_EBData.H:223
__host__ __device__ auto get(int box_no, int i, int j, int k, int n) const noexcept
Definition AMReX_EBData.H:209
static constexpr int real_data_size
Definition AMReX_EBData.H:220
Array4< EBCellFlag const > const *__restrict__ m_cell_flag
Definition AMReX_EBData.H:222
__host__ __device__ auto get(int box_no, int i, int j, int k) const noexcept
Definition AMReX_EBData.H:193
__host__ __device__ EBData get(int box_no) const noexcept
Definition AMReX_EBData.H:215
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:63
__host__ __device__ const auto & get() const noexcept
Definition AMReX_EBData.H:40
Array4< EBCellFlag const > const * m_cell_flag
Definition AMReX_EBData.H:185
static constexpr int real_data_size
Definition AMReX_EBData.H:183
Array4< Real const > const * m_real_data
Definition AMReX_EBData.H:186
__host__ __device__ auto get(int i, int j, int k, int n) const noexcept
Definition AMReX_EBData.H:56
__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:43
Definition AMReX_RandomEngine.H:72