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
 

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...
 

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

◆ 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).

248  {
249  const int kt = top(ci, cj, top.begin[2]);
250  return (kt < 0) ? z_ground : z_ground + (kt + 1) * dz;
251  }
real(c_double), private ci
Definition: ERF_module_mp_morr_two_moment.F90:203
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(), and ibseb::ray_hit().

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).

233  {
234  if (ci < top.begin[0] || ci >= top.end[0]) {
235  if (!wrap_x) { return false; }
236  ci = top.begin[0] + ((ci - top.begin[0]) % nx + nx) % nx;
237  }
238  if (cj < top.begin[1] || cj >= top.end[1]) {
239  if (!wrap_y) { return false; }
240  cj = top.begin[1] + ((cj - top.begin[1]) % ny + ny) % ny;
241  }
242  return true;
243  }
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 ibseb::ray_blocked(), and ibseb::ray_hit().

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 ibseb::ray_blocked(), ibseb::ray_hit(), 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(), ibseb::ray_hit(), 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().

◆ 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(), 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 ibseb::ray_blocked(), ibseb::ray_hit(), and IBFaceSet::ray_map().

◆ z_ground

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

Ground height [m].

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

◆ 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(), ibseb::ray_hit(), and IBFaceSet::ray_map().


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