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)
 

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 
)
953 {
954  const auto dx = cgeom.CellSizeArray();
955  const auto prob_lo = cgeom.ProbLoArray();
956 
957  for (MFIter mfi(*tags); mfi.isValid(); ++mfi) {
958  TagBox& tag = (*tags)[mfi];
959  auto tag_arr = tag.array(); // Get device-accessible array
960 
961  const Box& tile_box = mfi.tilebox(); // The box for this tile
962 
963  ParallelFor(tile_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
964  // Compute cell center coordinates
965  Real x = prob_lo[0] + (i + myhalf) * dx[0];
966  Real y = prob_lo[1] + (j + myhalf) * dx[1];
967 
968  Real dist = std::sqrt((x - eye_x)*(x - eye_x) + (y - eye_y)*(y - eye_y));
969 
970  if (dist < rad_tag) {
971  tag_arr(i,j,k) = TagBox::SET;
972  } else {
973  tag_arr(i,j,k) = TagBox::CLEAR;
974  }
975  });
976  }
977 }
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11
const Real dx
Definition: ERF_InitCustomPert_ABL.H:23
const amrex::Real * prob_lo
Definition: ERF_InitCustomPert_DataAssimilation_ISV.H:16
ParallelFor(grown_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: