ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ibseb::RayMap Struct Reference

#include <ERF_IBSEBSolar.H>

Collaboration diagram for ibseb::RayMap:

Public Member Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool locate (int &ci, int &cj) const noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real column_top (int ci, int cj) const noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real centre_x (int ci) const noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real centre_y (int cj) const noexcept
 

Public Attributes

amrex::Array4< const int > top
 Column tops over the patch (any k index; use top.begin[2]) More...
 
int ilo = 0
 
int jlo = 0
 Low corner of the domain, in cells. More...
 
int nx = 0
 
int ny = 0
 Columns of the domain in x and y. More...
 
bool wrap_x = false
 
bool wrap_y = false
 The patch spans the periodic domain in x / y. More...
 
amrex::Real x_lo = 0.0
 
amrex::Real y_lo = 0.0
 Physical position of the domain's low corner [m]. More...
 
amrex::Real dx = 0.0
 
amrex::Real dy = 0.0
 
amrex::Real dz = 0.0
 Cell sizes [m]. More...
 
amrex::Real z_ground = 0.0
 Ground height [m]. More...
 
amrex::Real z_max = 0.0
 Tallest column the map holds [m]; a ray above it meets nothing. More...
 
int max_steps = 0
 Columns a ray at the map's floor elevation crosses before it clears z_max (the halo's reach in x plus y) More...
 
int reach_x = 0
 
int reach_y = 0
 The halo's reach in x and in y, in columns, before the domain cap: every patch holds that many columns around its rank's boxes (or stops at a closed domain edge, or wraps) More...
 

Detailed Description

The column tops a ray cast on one rank sees: a k-collapsed map over this rank's patch of the level (its boxes grown by the halo of IBFaceSet::build_ray_map()), with the domain and the grid it is drawn on. An entry is the domain-relative k of the highest solid cell of its column, -1 where the column is fluid; column_top() turns it into a height. The patch holds the columns of other ranks and the periodic images within the halo, so the walk needs no communication. Where wrap_x (wrap_y) is set the patch spans the whole periodic domain in x (y) and a ray that leaves it comes back in on the other side; otherwise a ray that leaves the patch has left the map: the far field is open ground (see locate()). A ray is followed for as many columns as the halo's reach holds (max_steps), which is every column a ray no shallower than the map's floor can cross before it clears the tallest column or reaches the ground; a shallower ray stops there too, so a building beyond the halo's reach never shades, whether the map wraps or not. A level ray is followed for two rounds of the map and then counts as sky.

Member Function Documentation

◆ centre_x()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real ibseb::RayMap::centre_x ( int  ci) const
inlinenoexcept

Center of column ci in x (cj in y) [m]; the column is counted from the domain's low corner and may lie outside it.

256 { return x_lo + (static_cast<amrex::Real>(ci - ilo) + amrex::Real(0.5)) * dx; }
real(c_double), private ci
Definition: ERF_module_mp_morr_two_moment.F90:203
amrex::Real x_lo
Definition: ERF_IBSEBSolar.H:224
int ilo
Definition: ERF_IBSEBSolar.H:221
amrex::Real dx
Definition: ERF_IBSEBSolar.H:225

Referenced by IBFaceSet::compute_ground_shadow(), and ibseb::ray_blocked_near().

Here is the caller graph for this function:

◆ centre_y()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real ibseb::RayMap::centre_y ( int  cj) const
inlinenoexcept
258 { return y_lo + (static_cast<amrex::Real>(cj - jlo) + amrex::Real(0.5)) * dy; }
amrex::Real y_lo
Physical position of the domain's low corner [m].
Definition: ERF_IBSEBSolar.H:224
amrex::Real dy
Definition: ERF_IBSEBSolar.H:225
int jlo
Low corner of the domain, in cells.
Definition: ERF_IBSEBSolar.H:221

Referenced by IBFaceSet::compute_ground_shadow(), and ibseb::ray_blocked_near().

Here is the caller graph for this function:

◆ column_top()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real ibseb::RayMap::column_top ( int  ci,
int  cj 
) const
inlinenoexcept

Top height of column (ci, cj) of the map (the ground where it is fluid).

249  {
250  const int kt = top(ci, cj, top.begin[2]);
251  return (kt < 0) ? z_ground : z_ground + (kt + 1) * dz;
252  }
amrex::Array4< const int > top
Column tops over the patch (any k index; use top.begin[2])
Definition: ERF_IBSEBSolar.H:220
amrex::Real z_ground
Ground height [m].
Definition: ERF_IBSEBSolar.H:226
amrex::Real dz
Cell sizes [m].
Definition: ERF_IBSEBSolar.H:225

Referenced by ibseb::ray_blocked_walk(), and ibseb::ray_hit_landing().

Here is the caller graph for this function:

◆ locate()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool ibseb::RayMap::locate ( int &  ci,
int &  cj 
) const
inlinenoexcept

Whether the map holds column (ci, cj) (wrapped into the patch where the patch spans the domain).

234  {
235  if (ci < top.begin[0] || ci >= top.end[0]) {
236  if (!wrap_x) { return false; }
237  ci = top.begin[0] + ((ci - top.begin[0]) % nx + nx) % nx;
238  }
239  if (cj < top.begin[1] || cj >= top.end[1]) {
240  if (!wrap_y) { return false; }
241  cj = top.begin[1] + ((cj - top.begin[1]) % ny + ny) % ny;
242  }
243  return true;
244  }
bool wrap_x
Definition: ERF_IBSEBSolar.H:223
int ny
Columns of the domain in x and y.
Definition: ERF_IBSEBSolar.H:222
bool wrap_y
The patch spans the periodic domain in x / y.
Definition: ERF_IBSEBSolar.H:223
int nx
Definition: ERF_IBSEBSolar.H:222

Referenced by IBFaceSet::compute_ground_walls(), ibseb::ray_blocked_walk(), and ibseb::ray_hit_landing().

Here is the caller graph for this function:

Member Data Documentation

◆ dx

amrex::Real ibseb::RayMap::dx = 0.0

◆ dy

amrex::Real ibseb::RayMap::dy = 0.0

◆ dz

amrex::Real ibseb::RayMap::dz = 0.0

Cell sizes [m].

Referenced by column_top(), and IBFaceSet::ray_map().

◆ ilo

int ibseb::RayMap::ilo = 0

◆ jlo

int ibseb::RayMap::jlo = 0

Low corner of the domain, in cells.

Referenced by centre_y(), ibseb::ray_blocked_walk(), ibseb::ray_hit_landing(), and IBFaceSet::ray_map().

◆ max_steps

int ibseb::RayMap::max_steps = 0

Columns a ray at the map's floor elevation crosses before it clears z_max (the halo's reach in x plus y)

Referenced by ibseb::ray_blocked_walk(), ibseb::ray_hit_landing(), and IBFaceSet::ray_map().

◆ nx

int ibseb::RayMap::nx = 0

Referenced by locate(), and IBFaceSet::ray_map().

◆ ny

int ibseb::RayMap::ny = 0

Columns of the domain in x and y.

Referenced by locate(), and IBFaceSet::ray_map().

◆ reach_x

int ibseb::RayMap::reach_x = 0

◆ reach_y

int ibseb::RayMap::reach_y = 0

The halo's reach in x and in y, in columns, before the domain cap: every patch holds that many columns around its rank's boxes (or stops at a closed domain edge, or wraps)

Referenced by ibseb::ray_blocked_walk(), and IBFaceSet::ray_map().

◆ top

amrex::Array4<const int> ibseb::RayMap::top

Column tops over the patch (any k index; use top.begin[2])

Referenced by column_top(), locate(), ibseb::ray_hit_landing(), and IBFaceSet::ray_map().

◆ wrap_x

bool ibseb::RayMap::wrap_x = false

Referenced by locate(), and IBFaceSet::ray_map().

◆ wrap_y

bool ibseb::RayMap::wrap_y = false

The patch spans the periodic domain in x / y.

Referenced by locate(), and IBFaceSet::ray_map().

◆ x_lo

amrex::Real ibseb::RayMap::x_lo = 0.0

◆ y_lo

amrex::Real ibseb::RayMap::y_lo = 0.0

Physical position of the domain's low corner [m].

Referenced by centre_y(), ibseb::ray_blocked_walk(), ibseb::ray_hit_landing(), and IBFaceSet::ray_map().

◆ z_ground

amrex::Real ibseb::RayMap::z_ground = 0.0

◆ z_max

amrex::Real ibseb::RayMap::z_max = 0.0

Tallest column the map holds [m]; a ray above it meets nothing.

Referenced by ibseb::ray_blocked_walk(), ibseb::ray_hit_landing(), and IBFaceSet::ray_map().


The documentation for this struct was generated from the following file: