1 #ifndef ERF_TERRAIN_IF_H_
2 #define ERF_TERRAIN_IF_H_
4 #include <AMReX_Array.H>
5 #include <AMReX_EB2_IF_Base.H>
17 TerrainIF (amrex::FArrayBox& a_z_terrain, amrex::Geometry& a_geom)
21 amrex::Print() <<
" EB type = Terrain " << std::endl;
24 AMREX_GPU_HOST_DEVICE
inline
25 amrex::Real
operator() (AMREX_D_DECL(amrex::Real
x, amrex::Real
y, amrex::Real
z))
28 amrex::Real dx =
m_geom.CellSizeArray()[0];
29 amrex::Real dy =
m_geom.CellSizeArray()[1];
31 const int i =
static_cast<int>(
x / dx);
32 const int j =
static_cast<int>(
y / dy);
34 amrex::Array4<amrex::Real const>
const& terr_arr =
m_terr.const_array();
36 return -(
z - terr_arr(i,j,0));
39 inline amrex::Real
operator() (
const amrex::RealArray& p)
const noexcept
41 return this->
operator() (AMREX_D_DECL(p[0], p[1], p[2]));
Definition: ERF_TerrainIF.H:14
amrex::FArrayBox & m_terr
Definition: ERF_TerrainIF.H:45
TerrainIF(amrex::FArrayBox &a_z_terrain, amrex::Geometry &a_geom)
Definition: ERF_TerrainIF.H:17
AMREX_GPU_HOST_DEVICE amrex::Real operator()(AMREX_D_DECL(amrex::Real x, amrex::Real y, amrex::Real z)) const noexcept
Definition: ERF_TerrainIF.H:25
amrex::Geometry & m_geom
Definition: ERF_TerrainIF.H:46