ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ERF_Advance.cpp File Reference
#include <ERF.H>
#include <ERF_Utils.H>
Include dependency graph for ERF_Advance.cpp:

Functions

void check_for_negative_theta (amrex::MultiFab &S_old)
 

Function Documentation

◆ check_for_negative_theta()

void check_for_negative_theta ( amrex::MultiFab &  S_old)

Function that advances the solution at one level for a single time step – this does some preliminaries then calls erf_advance

Parameters
[in]levlevel of refinement (coarsest level is 0)
[in]timestart time for time advance
[in]dt_levtime step for this time advance
295 {
296  // *****************************************************************************
297  // Test for negative (rho theta)
298  // *****************************************************************************
299  for (MFIter mfi(S_old); mfi.isValid(); ++mfi)
300  {
301  Box bx = mfi.tilebox();
302  const Array4<Real> &cell_data = S_old.array(mfi);
303  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
304  {
305 #ifdef AMREX_USE_GPU
306  if (cell_data(i,j,k,RhoTheta_comp) <= 0.) AMREX_DEVICE_PRINTF("BAD THETA AT %d %d %d %e %e \n",
307  i,j,k,cell_data(i,j,k,RhoTheta_comp),cell_data(i,j,k+1,RhoTheta_comp));
308 #else
309  if (cell_data(i,j,k,RhoTheta_comp) <= 0.) {
310  printf("BAD THETA AT %d %d %d %e %e \n",
311  i,j,k,cell_data(i,j,k,RhoTheta_comp),cell_data(i,j,k+1,RhoTheta_comp));
312  amrex::Abort("Bad theta in check_for_negative_theta");
313  }
314 #endif
315  });
316  } // mfi
317 }
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37

Referenced by ERF::Advance().

Here is the caller graph for this function: