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 
)
833 {
834  const auto dx = cgeom.CellSizeArray();
835  const auto prob_lo = cgeom.ProbLoArray();
836 
837  for (MFIter mfi(*tags); mfi.isValid(); ++mfi) {
838  TagBox& tag = (*tags)[mfi];
839  auto tag_arr = tag.array(); // Get device-accessible array
840 
841  const Box& tile_box = mfi.tilebox(); // The box for this tile
842 
843  ParallelFor(tile_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
844  // Compute cell center coordinates
845  Real x = prob_lo[0] + (i + myhalf) * dx[0];
846  Real y = prob_lo[1] + (j + myhalf) * dx[1];
847 
848  Real dist = std::sqrt((x - eye_x)*(x - eye_x) + (y - eye_y)*(y - eye_y));
849 
850  if (dist < rad_tag) {
851  tag_arr(i,j,k) = TagBox::SET;
852  } else {
853  tag_arr(i,j,k) = TagBox::CLEAR;
854  }
855  });
856  }
857 }
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11
const Real dx
Definition: ERF_InitCustomPert_ABL.H:23
ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const auto prob_lo=geomdata.ProbLo();const auto dx=geomdata.CellSize();const Real x=(prob_lo[0]+(i+myhalf) *dx[0])/mf_m(i, j, 0);const Real z=z_cc(i, j, k);Real L=std::sqrt(std::pow((x - x_c)/x_r, 2)+std::pow((z - z_c)/z_r, 2));if(L<=one) { Real dT=T_pert *(std::cos(PI *L)+one)/two;Real Tbar_hse=p_hse(i, j, k)/(R_d *r_hse(i, j, k));Real theta_perturbed=(Tbar_hse+dT) *std::pow(p_0/p_hse(i, j, k), rdOcp);Real theta_0=(Tbar_hse) *std::pow(p_0/p_hse(i, j, k), rdOcp);if(const_rho) { state_pert(i, j, k, RhoTheta_comp)=r_hse(i, j, k) *(theta_perturbed - theta_0);} else { state_pert(i, j, k, Rho_comp)=getRhoThetagivenP(p_hse(i, j, k))/theta_perturbed - r_hse(i, j, k);} } })
const amrex::Real * prob_lo
Definition: ERF_InitCustomPert_IsentropicVortex.H:16
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: