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 
)
84 {
85  const auto dx = cgeom.CellSizeArray();
86  const auto prob_lo = cgeom.ProbLoArray();
87 
88  for (MFIter mfi(*tags); mfi.isValid(); ++mfi) {
89  TagBox& tag = (*tags)[mfi];
90  auto tag_arr = tag.array(); // Get device-accessible array
91 
92  const Box& tile_box = mfi.tilebox(); // The box for this tile
93 
94  ParallelFor(tile_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
95  // Compute cell center coordinates
96  Real x = prob_lo[0] + (i + myhalf) * dx[0];
97  Real y = prob_lo[1] + (j + myhalf) * dx[1];
98 
99  Real dist = std::sqrt((x - eye_x)*(x - eye_x) + (y - eye_y)*(y - eye_y));
100 
101  if (dist < rad_tag) {
102  tag_arr(i,j,k) = TagBox::SET;
103  }
104  });
105  }
106 }
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:13
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: