#include <cmath>
#include <AMReX_Extension.H>
#include <AMReX_GpuQualifiers.H>
#include <AMReX_REAL.H>
Go to the source code of this file.
|
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int | bndry_plane_index (int i, int lo, int hi, bool periodic) noexcept |
| |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE PlaneIndex | plane_index (int i, int ratio, bool nodal, int plo, int phi, bool periodic) noexcept |
| |
◆ bndry_plane_index()
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int bndry_plane_index |
( |
int |
i, |
|
|
int |
lo, |
|
|
int |
hi, |
|
|
bool |
periodic |
|
) |
| |
|
noexcept |
The index along a boundary plane that fills the ghost cell at index i: inside the domain, i itself; outside it, the periodic image when the direction is periodic, so that a ghost cell beside the inflow face holds what the plane holds at the periodic image (as the interior cells across the seam do); else the nearest cell of the plane. A plane holds the domain's cells only along its face, so its ghost cells in the other directions come from here.
20 if (i >= lo && i <= hi) {
return i; }
22 const int n =
hi -
lo + 1;
23 const int r = (i -
lo) % n;
24 return lo + ((r < 0) ? r + n : r);
26 return (i < lo) ?
lo :
hi;
Referenced by plane_index().
◆ plane_index()
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE PlaneIndex plane_index |
( |
int |
i, |
|
|
int |
ratio, |
|
|
bool |
nodal, |
|
|
int |
plo, |
|
|
int |
phi, |
|
|
bool |
periodic |
|
) |
| |
|
noexcept |
46 const Real
x = (nodal ? Real(i) : Real(i) + Real(0.5)) / Real(ratio) - Real(0.5);
47 const int i0 =
static_cast<int>(std::floor(x));
48 const Real w =
x - Real(i0);
GpuArray< Real, AMREX_SPACEDIM > plo
Definition: ERF_ActuatorSpreading.cpp:131
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int bndry_plane_index(int i, int lo, int hi, bool periodic) noexcept
Definition: ERF_BndryPlaneIndex.H:18
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real phi(amrex::Real d, amrex::Real z0, amrex::Real psi) noexcept
Definition: ERF_ImmersedWallCell.H:176
Referenced by ERF::fill_from_bndryregs().