ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_TerrainSurfaceSlab.cpp File Reference
#include "ERF_TerrainSurfaceSlab.H"
#include "ERF_ProbCommon.H"
#include <AMReX_FArrayBox.H>
#include <AMReX_MFIter.H>
Include dependency graph for ERF_TerrainSurfaceSlab.cpp:

Functions

BoxArray bottom_node_slab (const BoxArray &ba, const Geometry &geom)
 
void fill_terrain_surface_slab (MultiFab &zs, const Geometry &geom, ProblemBase &prob, double time)
 

Function Documentation

◆ bottom_node_slab()

BoxArray bottom_node_slab ( const BoxArray &  ba,
const Geometry &  geom 
)
14 {
15  const int klo = geom.Domain().smallEnd(2);
16  BoxList bl = ba.boxList();
17  bl.convert(IndexType::TheNodeType()); // the list's index type as well as each box's
18  for (auto& b : bl) {
19  b.setRange(2, klo);
20  }
21  return BoxArray(std::move(bl));
22 }
const int klo
Definition: ERF_InitCustomPert_ABL.H:75

Referenced by ERF::station_ground(), and ObsNudging::surface().

Here is the caller graph for this function:

◆ fill_terrain_surface_slab()

void fill_terrain_surface_slab ( MultiFab &  zs,
const Geometry &  geom,
ProblemBase &  prob,
double  time 
)
26 {
27  // The whole domain at once, as ERF::fill_terrain_surface and the immersed
28  // boundary build it, so that the surface is the same whichever box asks
29  const int klo = geom.Domain().smallEnd(2);
30  const Box bx(surroundingNodes(geom.Domain()));
31  FArrayBox terrain_fab(makeSlab(bx, 2, klo), 1);
32  prob.init_terrain_surface(geom, terrain_fab, time);
33  for (MFIter mfi(zs); mfi.isValid(); ++mfi) {
34  const Box isect = terrain_fab.box() & zs[mfi].box();
35  if (!isect.isEmpty()) {
36  zs[mfi].template copy<RunOn::Device>(terrain_fab, isect, 0, isect, 0, 1);
37  }
38  }
39 }
void init_terrain_surface(const amrex::Geometry &geom, amrex::FArrayBox &terrain_fab, const double &time)
Definition: ERF_ProbCommon.H:366

Referenced by ERF::station_ground(), and ObsNudging::surface().

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