ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
erf_detail_PoissonWallDist Namespace Reference

Functions

void assert_surface_gathered (const MultiFab &znd_surf)
 

Detailed Description

Stop unless every surface node, valid and x/y ghost, was gathered. The slab has no z ghosts, so the reduction runs over its own ghost vector.

Parameters
znd_surfSurface slab filled by fill_surface_nodes

Function Documentation

◆ assert_surface_gathered()

void erf_detail_PoissonWallDist::assert_surface_gathered ( const MultiFab &  znd_surf)
42 {
43  Real znd_max = ReduceMax(znd_surf, znd_surf.nGrowVect(),
44  [=] AMREX_GPU_HOST_DEVICE (Box const& bx, Array4<Real const> const& a) -> Real
45  {
46  Real m = std::numeric_limits<Real>::lowest();
47  amrex::Loop(bx, [&] (int i, int j, int k) { m = amrex::max(m, a(i,j,k)); });
48  return m;
49  });
50  ParallelAllReduce::Max(znd_max, ParallelContext::CommunicatorSub());
51  // Same threshold as fill_surface_nodes: a node interpolated from a stencil that still
52  // held bogus values is a fraction of bogus_large_value, not equal to it
54  "poisson_wall_dist: the surface nodes were not gathered onto every box");
55 }
constexpr amrex::Real bogus_large_value
Definition: ERF_Constants.H:19
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(axis >=0 &&axis< AMREX_SPACEDIM, "prob.axis must be 0, 1 or 2")

Referenced by ERF::poisson_wall_dist().

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