ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Tagging.cpp File Reference
#include <ERF.H>
#include <ERF_Derive.H>
Include dependency graph for ERF_Tagging.cpp:

Functions

void tag_on_distance_from_eye (const Geometry &cgeom, TagBoxArray *tags, const Real eye_x, const Real eye_y, const Real rad_tag)
 Tag cells based on 2D distance from the storm eye. More...
 

Function Documentation

◆ tag_on_distance_from_eye()

void tag_on_distance_from_eye ( const Geometry &  cgeom,
TagBoxArray *  tags,
const Real  eye_x,
const Real  eye_y,
const Real  rad_tag 
)

Tag cells based on 2D distance from the storm eye.

Parameters
[in]cgeomGeometry defining the domain.
[out]tagsArray of tagged cells for refinement.
[in]eye_xX-coordinate of the eye center.
[in]eye_yY-coordinate of the eye center.
[in]rad_tagRadius within which cells are tagged.

Tag cells based on distance from the hurricane eye.

Parameters
cgeomGeometry used for coordinates.
[out]tagsTagBoxArray to be filled.
eye_xx-coordinate of the eye.
eye_yy-coordinate of the eye.
rad_tagRadius within which to tag.
112 {
113  const auto dx = cgeom.CellSizeArray();
114  const auto prob_lo = cgeom.ProbLoArray();
115 
116  for (MFIter mfi(*tags); mfi.isValid(); ++mfi) {
117  TagBox& tag = (*tags)[mfi];
118  auto tag_arr = tag.array(); // Get device-accessible array
119 
120  const Box& tile_box = mfi.tilebox(); // The box for this tile
121 
122  ParallelFor(tile_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
123  // Compute cell center coordinates
124  Real x = prob_lo[0] + (i + myhalf) * dx[0];
125  Real y = prob_lo[1] + (j + myhalf) * dx[1];
126 
127  Real dist = std::sqrt((x - eye_x)*(x - eye_x) + (y - eye_y)*(y - eye_y));
128 
129  if (dist < rad_tag) {
130  tag_arr(i,j,k) = TagBox::SET;
131  }
132  });
133  }
134 }
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:13
const Real dx
Definition: ERF_InitCustomPert_ABL.H:44
const GpuArray< Real, AMREX_SPACEDIM > prob_lo
Definition: ERF_InitCustomPert_CloudChamber.H:33
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
amrex::Real Real
Definition: ERF_ShocInterface.H:19

Referenced by ERF::ErrorEst(), and ERF::HurricaneTracker().

Here is the call graph for this function:
Here is the caller graph for this function: