#include <ERF_EBIFTerrain.H>
|
| TerrainIF (amrex::FArrayBox const &a_z_terrain, amrex::Geometry const &a_geom, amrex::Gpu::DeviceVector< amrex::Real > &a_dz_stretched) |
|
AMREX_GPU_HOST_DEVICE amrex::Real | operator() (AMREX_D_DECL(amrex::Real x, amrex::Real y, amrex::Real z)) const noexcept |
|
AMREX_GPU_HOST_DEVICE amrex::Real | operator() (const amrex::RealArray &p) const noexcept |
|
◆ TerrainIF()
TerrainIF::TerrainIF |
( |
amrex::FArrayBox const & |
a_z_terrain, |
|
|
amrex::Geometry const & |
a_geom, |
|
|
amrex::Gpu::DeviceVector< amrex::Real > & |
a_dz_stretched |
|
) |
| |
|
inline |
19 :
terr_arr(a_z_terrain.const_array()),
20 dz_s(a_dz_stretched.data()),
21 dx(a_geom.CellSize(0)),
22 dy(a_geom.CellSize(1)),
23 dz(a_geom.CellSize(2)),
29 i_hi(
static_cast<int>(std::round((a_geom.ProbHi(0)-a_geom.ProbLo(0))/a_geom.CellSize(0)))),
30 j_hi(
static_cast<int>(std::round((a_geom.ProbHi(1)-a_geom.ProbLo(1))/a_geom.CellSize(1))))
amrex::Real prob_lo_x
Definition: ERF_EBIFTerrain.H:124
amrex::Real dy
Definition: ERF_EBIFTerrain.H:123
int j_hi
Definition: ERF_EBIFTerrain.H:126
amrex::Array4< amrex::Real const > terr_arr
Definition: ERF_EBIFTerrain.H:121
amrex::Real prob_hi_x
Definition: ERF_EBIFTerrain.H:125
amrex::Real const * dz_s
Definition: ERF_EBIFTerrain.H:122
amrex::Real prob_lo_y
Definition: ERF_EBIFTerrain.H:124
amrex::Real dx
Definition: ERF_EBIFTerrain.H:123
amrex::Real prob_lo_z
Definition: ERF_EBIFTerrain.H:124
int i_hi
Definition: ERF_EBIFTerrain.H:126
amrex::Real dz
Definition: ERF_EBIFTerrain.H:123
amrex::Real prob_hi_y
Definition: ERF_EBIFTerrain.H:125
◆ operator()() [1/2]
AMREX_GPU_HOST_DEVICE amrex::Real TerrainIF::operator() |
( |
AMREX_D_DECL(amrex::Real x, amrex::Real y, amrex::Real z) |
| ) |
const |
|
inlinenoexcept |
48 amrex::Real terr_z{0.};
51 const int k1 =
static_cast<int>(std::floor((
z-
prob_lo_z) /
dz));
53 const amrex::Real remainder_z = (
z - z1)/
dz;
55 for (
int kk = 0; kk < k1; ++kk) {
56 z_stretched +=
dz_s[kk];
58 z_stretched += remainder_z *
dz_s[k1];
67 }
else if (x <= prob_lo_x && y >=
prob_hi_y) {
104 const amrex::Real denom =
dx*
dy;
105 const amrex::Real w11 = (x2-
x)*(y2-
y)/denom;
106 const amrex::Real w12 = (x2-
x)*(
y-y1)/denom;
107 const amrex::Real w21 = (
x-x1)*(y2-
y)/denom;
108 const amrex::Real w22 = (
x-x1)*(
y-y1)/denom;
111 return -(z_stretched - terr_z);
Referenced by operator()().
◆ operator()() [2/2]
AMREX_GPU_HOST_DEVICE amrex::Real TerrainIF::operator() |
( |
const amrex::RealArray & |
p | ) |
const |
|
inlinenoexcept |
117 return this->
operator() (AMREX_D_DECL(p[0], p[1], p[2]));
AMREX_GPU_HOST_DEVICE amrex::Real operator()(AMREX_D_DECL(amrex::Real x, amrex::Real y, amrex::Real z)) const noexcept
Definition: ERF_EBIFTerrain.H:34
◆ dx
amrex::Real TerrainIF::dx |
|
protected |
◆ dy
amrex::Real TerrainIF::dy |
|
protected |
◆ dz
amrex::Real TerrainIF::dz |
|
protected |
◆ dz_s
amrex::Real const* TerrainIF::dz_s |
|
protected |
◆ i_hi
◆ j_hi
◆ prob_hi_x
amrex::Real TerrainIF::prob_hi_x |
|
protected |
◆ prob_hi_y
amrex::Real TerrainIF::prob_hi_y |
|
protected |
◆ prob_lo_x
amrex::Real TerrainIF::prob_lo_x |
|
protected |
◆ prob_lo_y
amrex::Real TerrainIF::prob_lo_y |
|
protected |
◆ prob_lo_z
amrex::Real TerrainIF::prob_lo_z |
|
protected |
◆ terr_arr
amrex::Array4<amrex::Real const> TerrainIF::terr_arr |
|
protected |
The documentation for this class was generated from the following file: