ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_ActuatorSampling.H
Go to the documentation of this file.
1 #ifndef ERF_ACTUATOR_SAMPLING_H
2 #define ERF_ACTUATOR_SAMPLING_H
3 
4 /**
5  * Interpolation of the flow and of the terrain height at arbitrary points, and the check that
6  * points lie on a level's grids.
7  */
8 
9 #include <algorithm>
10 #include <cmath>
11 #include <string>
12 #include <vector>
13 
14 #include <AMReX_Geometry.H>
15 #include <AMReX_MultiFab.H>
16 #include <AMReX_REAL.H>
17 
19 
20 namespace erf_actuator {
21 
22 /// Abort, naming who, unless every rank passes the same number of points (one collective).
23 void check_same_points_everywhere (int npts, const char* who);
24 
25 /**
26  * Sample the velocity at a set of points from the face-centered velocity fields.
27  *
28  * Each component is interpolated trilinearly from its own staggered grid: u from the x faces,
29  * v from the y faces, w from the z faces, so a field linear in x, y and z is reproduced
30  * exactly. The vertical weight uses the physical face heights (z_phys_nd on a stretched or
31  * terrain-following mesh, prob_lo + k dz otherwise), so the same holds on those meshes as long
32  * as the field is linear in the physical height.
33  *
34  * Every rank interpolates the points whose containing cell lies in one of its valid boxes,
35  * reading the neighbors from the ghost cells, and the results are summed across ranks; the
36  * velocity fields must therefore have at least one filled ghost cell, and z_phys_nd one ghost
37  * node, on the velocities' boxes and distribution. The ghost cells across the domain's lateral
38  * boundaries are read too (a point within half a cell of a non-periodic face takes up to half
39  * its value from them), so the fields must be filled there as well (FillPatch, not only
40  * FillBoundary). In a periodic direction a point is moved by whole periods into the domain; a
41  * point on the domain's upper x, y or z face belongs to the last cell. A point outside the
42  * domain otherwise, or one found by no rank or by more than one, aborts
43  * with its coordinates: the caller owns the points and must keep them inside the domain. Every
44  * rank must pass the same points: the reduction is collective and the call stops when the ranks
45  * disagree on their number. A model whose ranks hold different points (those of the bodies
46  * each owns) calls sample_velocity_local() instead, which has no such check.
47  *
48  * @param[in] U,V,W face-centered velocities on one level, ghost cells filled (m/s)
49  * @param[in] z_phys_nd nodal physical heights (m), or nullptr on a uniform-dz mesh
50  * @param[in] geom the level's geometry
51  * @param[in] pos 3*n point coordinates (x0,y0,z0, x1,y1,z1, ...) (m, ERF domain coordinates)
52  * @param[out] vel 3*n sampled velocities (m/s), the same on every rank on return
53  */
54 void sample_velocity (const amrex::MultiFab& U,
55  const amrex::MultiFab& V,
56  const amrex::MultiFab& W,
57  const amrex::MultiFab* z_phys_nd,
58  const amrex::Geometry& geom,
59  const std::vector<amrex::Real>& pos,
60  std::vector<amrex::Real>& vel);
61 
62 /**
63  * The part of sample_velocity() that a rank does on its own: the velocity at each of the points that
64  * one of this rank's boxes holds (cnt 1), zero with cnt 0 at the others. No reduction and no check:
65  * the caller combines the ranks' answers. The points must already be moved into the domain across
66  * its periodic seams (wrap_periodic).
67  * @param[in] wpos 3*n point coordinates inside the domain (m)
68  * @param[out] vel 3*n velocities (m/s), zero at the points no box of this rank holds
69  * @param[out] cnt n counts: how many of this rank's boxes hold each point (0 or 1)
70  * @param buffers device memory kept from call to call (the call uses its own when nullptr); the points
71  * go to the device and the answers come back with asynchronous copies and one synchronization
72  */
73 void sample_velocity_local (const amrex::MultiFab& U,
74  const amrex::MultiFab& V,
75  const amrex::MultiFab& W,
76  const amrex::MultiFab* z_phys_nd,
77  const amrex::Geometry& geom,
78  const std::vector<amrex::Real>& wpos,
79  std::vector<amrex::Real>& vel,
80  std::vector<int>& cnt,
81  ActuatorDeviceBuffers* buffers = nullptr);
82 
83 /**
84  * The points (3 coordinates each, m) with their coordinates in every periodic direction moved by
85  * whole periods into [prob_lo, prob_hi): the image the boxes hold, so that a point that has crossed
86  * a periodic seam is sampled on the far side.
87  */
88 std::vector<amrex::Real> wrap_periodic (const std::vector<amrex::Real>& pos, const amrex::Geometry& geom);
89 
90 /**
91  * Sample one component of a cell-centered field at a set of points: bilinear between the four
92  * cell centers around the point in the horizontal and linear in the physical height between
93  * the two cell centers that bracket it in the column (cell-center heights from z_phys_nd on a
94  * stretched or terrain-following mesh); below the first and above the last cell center the
95  * nearest pair extrapolates linearly. Same ownership rules and reduction as sample_velocity();
96  * the field needs one filled ghost cell.
97  *
98  * @param[in] mf the cell-centered field
99  * @param[in] comp the component of mf (0-based)
100  * @param[in] pos 3*n point coordinates (m, ERF domain coordinates)
101  * @param[out] val n sampled values, the same on every rank on return
102  */
103 void sample_cell_scalar (const amrex::MultiFab& mf, int comp,
104  const amrex::MultiFab* z_phys_nd,
105  const amrex::Geometry& geom,
106  const std::vector<amrex::Real>& pos,
107  std::vector<amrex::Real>& val);
108 
109 /**
110  * Return the height of the terrain surface (the k = 0 node plane of z_phys_nd, bilinear between
111  * the four mesh nodes around each point's (x, y)) under a set of points; prob_lo z everywhere on
112  * a uniform-dz mesh (z_phys_nd null), where no point is checked. Otherwise the same ownership
113  * rules, periodic images and reduction as sample_velocity(): the points must lie inside the domain
114  * horizontally, a point on the domain's upper x or y face belonging to the last cell; z is ignored.
115  *
116  * @param[in] pos 3*n positions (m)
117  * @param[out] h n terrain heights (m), the same on every rank on return
118  */
119 void terrain_heights (const amrex::MultiFab* z_phys_nd, const amrex::Geometry& geom,
120  const std::vector<amrex::Real>& pos, std::vector<amrex::Real>& h);
121 
122 /**
123  * Return whether every point, with the cells within `reach` meters around it, lies inside the
124  * union of boxes of a level (the anchor level's grids): the sampler needs the neighboring cells
125  * and the spreader the kernel's reach, and on a refined level that is not the whole domain. In a
126  * periodic direction the needed cells wrap across the seam to the domain's other side; in a
127  * non-periodic one they are clamped to the domain. Returns false and names the first point
128  * outside in `first_outside`. On a terrain-following or stretched mesh a point's k is not its
129  * height over dz, so z is checked as `z` says: Reach (the cells within reach of the height over dz,
130  * for a flat, uniform mesh), Footprint (the reach across only, at any height: the sampler then finds
131  * a point above or below the grids by itself), or Column (for the spreading, whose kernel would
132  * otherwise be cut where the grids stop: the reach across over every cell the heights within reach
133  * may lie in, over the point's own columns from `cells` (column_cell_ranges, one range per point),
134  * else whatever the column from the mesh's bounds `zb` (mesh_z_bounds), or over the whole height
135  * without either). With `cells` a point whose range is empty (kb > kt) is not covered.
136  * Not with a periodic z.
137  */
138 enum class CoverZ { Reach, Footprint, Column };
139 
140 /**
141  * The lowest and highest ground and the smallest and largest spacing of the levels (m) of a mesh,
142  * and, over one rank's boxes (mesh_z_bounds with over_all_ranks false) or the level's (mesh_z_levels), a table of each node level's
143  * lowest and highest height and of the cells those boxes hold, which bounds the cells a height may
144  * lie in whether or not the boxes reach the ground (a column split in z, a level aloft).
145  */
146 struct ZBounds {
147  amrex::Real ground_lo{0.0}, ground_hi{0.0}, dz_lo{0.0}, dz_hi{0.0};
148  bool all_ground{true}; //!< every box of the level reaches the ground (else the bounds hold for those that do)
149  int k0{0}; //!< the node level of node_lo[0] and the cell of has_cell[0]
150  std::vector<amrex::Real> node_lo, node_hi; //!< node level k0 + n: the lowest and highest height (empty: no table)
151  std::vector<char> has_cell; //!< cell k0 + n is in one of the boxes
152 
153  /** Whether the level's grids reach the ground (a refined level aloft does not, and has no bounds). */
154  bool has_ground () const { return ground_lo <= ground_hi && dz_lo > amrex::Real(0.0); }
155  /** Whether the bounds come with the table of node heights: of one rank's boxes (mesh_z_bounds) or of
156  * every rank's (mesh_z_levels). */
157  bool has_table () const { return !has_cell.empty(); }
158 
159  /**
160  * The cells k that heights from zl to zh may lie in, whatever the column: [kb, kt], clamped to
161  * [klo - 1, khi + 1] (so a range outside the domain stays outside it); [klo, khi] without bounds.
162  * With the table: exactly the boxes' cells k whose lowest bottom node is not above zh and whose
163  * highest top node is not below zl, or kb > kt when there is none. zl or zh may be infinite (not NaN):
164  * heights from -infinity take every cell up to zh's, and a range at one infinity takes no cell of
165  * the domain.
166  */
167  void k_range (amrex::Real zl, amrex::Real zh, int klo, int khi, int& kb, int& kt) const
168  {
169  kb = klo;
170  kt = khi;
171  if (has_table()) {
172  kb = khi + 1;
173  kt = klo - 1;
174  // a relative 1e-5 more each way: the caller's zl and zh are rounded sums (a point's height and
175  // its reach), and a face at a node level's own height h just past them still has weight
176  // From the finite ends only: an infinite end needs none. An infinite end is replaced by 0 before
177  // the difference is taken, not skipped by a test, so that inf - inf is never computed (a compiler
178  // may evaluate both sides of a test, and the invalid operation would trap)
179  const amrex::Real fl = std::isinf(zl) ? amrex::Real(0.0) : zl;
180  const amrex::Real fh = std::isinf(zh) ? amrex::Real(0.0) : zh;
181  const amrex::Real slack = amrex::Real(1.0e-5) * std::max(std::abs(fl), std::max(std::abs(fh), std::abs(fh - fl)));
182  const amrex::Real lo = zl - slack, hi = zh + slack;
183  for (std::size_t n = 0; n < has_cell.size(); ++n) {
184  if (has_cell[n] == 0 || node_lo[n] > hi || node_hi[n+1] < lo) { continue; }
185  const int k = k0 + static_cast<int>(n);
186  kb = std::min(kb, k);
187  kt = std::max(kt, k);
188  }
189  return;
190  }
191  if (!has_ground()) { return; }
192  // counted from the ground's cell klo. A cell that only touches the range at a node is not always
193  // within [kb, kt]: the spreader takes one face level more each way (reach_box_k())
194  const double b = klo + std::floor((static_cast<double>(zl) - ground_hi) / dz_hi);
195  const double t = klo + std::floor((static_cast<double>(zh) - ground_lo) / dz_lo);
196  kb = static_cast<int>(std::min<double>(khi + 1, std::max<double>(klo - 1, b)));
197  kt = static_cast<int>(std::min<double>(khi + 1, std::max<double>(klo - 1, t)));
198  }
199 };
200 
201 /**
202  * The bounds of a terrain-following or stretched level's heights, from its z_phys_nd (nodal, one
203  * component): a height Z lies in a cell k with floor((Z - ground_hi) / dz_hi) <= k <= floor((Z -
204  * ground_lo) / dz_lo). Over every rank's boxes, the same on every rank (a collective), or with
205  * over_all_ranks false over this rank's boxes only, which bounds the cells of those boxes alone.
206  * With over_all_ranks false and a box of this rank that does not reach the ground (a column split
207  * in z, a level aloft), where that formula does not hold, also the table of the boxes' node heights
208  * (ZBounds::has_table). The table is this rank's: points_covered_by takes the global bounds only.
209  */
210 ZBounds mesh_z_bounds (const amrex::MultiFab& z_phys_nd, const amrex::Geometry& geom, bool over_all_ranks = true);
211 
212 /**
213  * mesh_z_bounds over every rank's boxes, with the table of the level's node heights over every
214  * rank's boxes too (ZBounds::has_table): each node level's lowest and highest height and the cells
215  * the level holds, the same on every rank (a collective). ZBounds::k_range then gives the cells of
216  * the level a height range may lie in whether or not the boxes reach the ground. For
217  * region_touches_grids; points_covered_by takes the bounds without a table.
218  */
219 ZBounds mesh_z_levels (const amrex::MultiFab& z_phys_nd, const amrex::Geometry& geom);
220 
221 /**
222  * mesh_z_levels of one level, kept between calls: the heights of a level change only when its boxes do
223  * (a regrid) or when the terrain moves, so a caller that needs the table at every step builds it once.
224  */
226 public:
227  /**
228  * The table of z_phys_nd's level. Built at the first call, and again when z_phys_nd's boxes or geom's
229  * domain differ from those of the last build, or with rebuild true (for heights that change in time on
230  * the same boxes: a moving terrain). A collective when it builds; every rank builds at the same calls,
231  * as the boxes, the domain and rebuild are the same on every rank.
232  */
233  const ZBounds& get (const amrex::MultiFab& z_phys_nd, const amrex::Geometry& geom, bool rebuild = false);
234  /** How many times get() has built the table. */
235  int builds () const { return m_builds; }
236 private:
238  amrex::BoxArray m_ba; //!< z_phys_nd's boxes at the last build
239  amrex::Box m_domain; //!< geom's domain at the last build
240  int m_builds{0};
241 };
242 
243 /**
244  * The cells of a terrain-following or stretched level that the heights within reach of each of a set of
245  * points may lie in, over the point's own columns (column_cell_ranges): point p needs the cells kb[p] to
246  * kt[p]; kb > kt when its reach touches no node of the level.
247  */
248 struct ColumnCells {
249  std::vector<int> kb, kt;
250  /** The ranges of n points from point `begin` (as a copy). */
251  ColumnCells slice (std::size_t begin, std::size_t n) const
252  {
253  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(begin + n <= kb.size() && kb.size() == kt.size(), "ColumnCells::slice: past the ranges");
254  ColumnCells c;
255  c.kb.assign(kb.begin() + static_cast<std::ptrdiff_t>(begin), kb.begin() + static_cast<std::ptrdiff_t>(begin + n));
256  c.kt.assign(kt.begin() + static_cast<std::ptrdiff_t>(begin), kt.begin() + static_cast<std::ptrdiff_t>(begin + n));
257  return c;
258  }
259 };
260 
261 /**
262  * The cells a point's heights within reach may lie in, over the point's own columns: for point p
263  * (pos[3p .. 3p+2], reach[p] across and in height, in meters), the lowest and highest cell k such that,
264  * in some node column the reach across touches (a periodic x or y wrapping across the seam, as
265  * points_covered_by takes it), the cell's spacing [z(k), z(k+1)] overlaps [z - reach, z + reach] (to a
266  * relative 1e-5, as ZBounds::k_range), from every rank's boxes of z_phys_nd. Where those heights go below
267  * a box's lowest node in a column (the box's bottom face, unless it is the domain's floor), the cell under
268  * that box counts too, and where they go above a box's highest node (unless it is the domain's top), the
269  * cell above it: in a column split in z between boxes those cells are held by the next box, and where the
270  * level stops they are not, so a kernel the level cuts fails points_covered_by, whatever the boxes. The
271  * range is the hull [min k, max k] over the columns: points_covered_by never accepts a kernel some cell
272  * of which the level lacks, and accepts every kernel whose cells the level holds when, over the columns
273  * within reach, those cells form one run and no column has the heights below its ground under a box
274  * that starts above the floor. Elsewhere it is conservative: it also asks for the cells of a gap between
275  * two runs, or the cell under such a box (a cliff next to the point on a level aloft). The coverage
276  * answer is the same whatever the boxes; the hull itself may differ by cells the level holds in the same
277  * run. A reach partly below the floor or above the domain top needs nothing there, as with the mesh's
278  * bounds; one wholly beyond them touches no node and is not covered. kb > kt for a point whose reach
279  * touches no node of the level. A collective, the same on every rank: every rank passes the same points.
280  *
281  * @param[in] pos 3*n positions (m)
282  * @param[in] reach n reaches (m)
283  * @param[out] cells the ranges of the n points
284  */
285 void column_cell_ranges (const amrex::MultiFab& z_phys_nd, const amrex::Geometry& geom,
286  const std::vector<amrex::Real>& pos, const std::vector<amrex::Real>& reach, ColumnCells& cells);
287 
288 bool points_covered_by (const amrex::BoxArray& ba, const amrex::Geometry& geom,
289  const std::vector<amrex::Real>& pos, amrex::Real reach, std::string& first_outside,
290  CoverZ z = CoverZ::Reach, const ZBounds* zb = nullptr, const ColumnCells* cells = nullptr);
291 
292 /**
293  * A level's boxes as points_covered_by tests them, built once for every test of a check: the boxes
294  * cell-centered, and flattened onto the domain's bottom layer (for CoverZ::Footprint).
295  */
297 {
298  CoverageGrids (const amrex::BoxArray& ba, const amrex::Geometry& geom);
299  amrex::BoxArray cells; //!< the boxes, cell-centered
300  amrex::BoxArray footprints; //!< each box flattened onto the bottom layer (they may overlap)
301 };
302 
303 /** points_covered_by on boxes built once (CoverageGrids of the same level and geometry). */
304 bool points_covered_by (const CoverageGrids& grids, const amrex::Geometry& geom,
305  const std::vector<amrex::Real>& pos, amrex::Real reach, std::string& first_outside,
306  CoverZ z = CoverZ::Reach, const ZBounds* zb = nullptr, const ColumnCells* cells = nullptr);
307 
308 /**
309  * Whether a level's boxes may hold a cell of a region (lo and hi in meters, lo <= hi in every
310  * direction, no NaN): the opposite question to points_covered_by, for a caller that must stay clear
311  * of a level. x and y use the cells the region's ends fall in (points_covered_by's own); in a
312  * periodic direction every image of the region counts, however many periods away, and a region a
313  * period or more long takes every cell. z must not be periodic. A region that overlaps a cell of
314  * the level is never missed; one that only meets a cell at a face may not count. In z:
315  * - on a uniform-dz mesh (zb null) the cells are the region's own, from prob_lo and the spacing;
316  * - with the level's table of node heights (mesh_z_levels), the cells k of the level some bottom
317  * node of which is not above the region and some top node not below it (ZBounds::k_range): right
318  * wherever the level's boxes are, on the ground or aloft, and no cell where the level has none
319  * at those heights;
320  * - with the level's bounds alone (mesh_z_bounds over all ranks) and every box on the ground,
321  * the cells between the ground and spacing extremes allow, which is wider on steep terrain;
322  * - with the bounds alone and a box that does not stand on the ground (ZBounds::all_ground false:
323  * a level or a box aloft, or a column split in z between boxes), the whole column: the answer is
324  * then yes wherever a box lies over or under the region's footprint.
325  * The cell indices are bounded before they become integers, so a region that reaches far outside
326  * the domain (or to infinity) is safe. The answer reads no field data and is the same on every
327  * rank when zb is: pass the table or the bounds over all ranks, not one rank's (which this function
328  * cannot tell apart).
329  *
330  * @param[in] ba the level's boxes (any index type)
331  * @param[in] geom the level's geometry
332  * @param[in] region the region (m)
333  * @param[in] zb the level's table or bounds on a stretched or terrain-following mesh, or nullptr
334  */
335 bool region_touches_grids (const amrex::BoxArray& ba, const amrex::Geometry& geom, const amrex::RealBox& region,
336  const ZBounds* zb = nullptr);
337 
338 } // namespace erf_actuator
339 
340 #endif
ZBounds zb
Definition: ERF_ActuatorSpreading.cpp:135
std::vector< std::array< Box, 3 > > reach
Definition: ERF_ActuatorSpreading.cpp:222
std::vector< std::array< Real, 3 > > pos
Definition: ERF_ActuatorSpreading.cpp:220
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(axis >=0 &&axis< AMREX_SPACEDIM, "prob.axis must be 0, 1 or 2")
const int khi
Definition: ERF_InitCustomPert_Bubble.H:25
const int klo
Definition: ERF_InitCustomPert_KE.H:9
Definition: ERF_ActuatorSampling.H:225
amrex::Box m_domain
geom's domain at the last build
Definition: ERF_ActuatorSampling.H:239
int builds() const
Definition: ERF_ActuatorSampling.H:235
amrex::BoxArray m_ba
z_phys_nd's boxes at the last build
Definition: ERF_ActuatorSampling.H:238
const ZBounds & get(const amrex::MultiFab &z_phys_nd, const amrex::Geometry &geom, bool rebuild=false)
Definition: ERF_ActuatorSampling.cpp:568
int m_builds
Definition: ERF_ActuatorSampling.H:240
ZBounds m_zb
Definition: ERF_ActuatorSampling.H:237
@ U
Definition: ERF_IndexDefines.H:178
@ V
Definition: ERF_IndexDefines.H:179
@ t
Definition: ERF_WSM6.H:295
Definition: ERF_ActuatorDeviceBuffers.H:14
bool points_covered_by(const BoxArray &ba, const Geometry &geom, const std::vector< Real > &pos, Real reach, std::string &first_outside, CoverZ z, const ZBounds *zb, const ColumnCells *cells)
Definition: ERF_ActuatorSampling.cpp:752
void sample_velocity(const MultiFab &U, const MultiFab &V, const MultiFab &W, const MultiFab *z_phys_nd, const Geometry &geom, const std::vector< Real > &pos, std::vector< Real > &vel)
Definition: ERF_ActuatorSampling.cpp:230
void sample_cell_scalar(const MultiFab &mf, int comp, const MultiFab *z_phys_nd, const Geometry &geom, const std::vector< Real > &pos, std::vector< Real > &val)
Definition: ERF_ActuatorSampling.cpp:282
ZBounds mesh_z_bounds(const MultiFab &z_phys_nd, const Geometry &geom, bool over_all_ranks)
Definition: ERF_ActuatorSampling.cpp:508
void sample_velocity_local(const MultiFab &U, const MultiFab &V, const MultiFab &W, const MultiFab *z_phys_nd, const Geometry &geom, const std::vector< Real > &wpos, std::vector< Real > &vel, std::vector< int > &cnt, ActuatorDeviceBuffers *buffers)
Definition: ERF_ActuatorSampling.cpp:119
ZBounds mesh_z_levels(const MultiFab &z_phys_nd, const Geometry &geom)
Definition: ERF_ActuatorSampling.cpp:552
CoverZ
Definition: ERF_ActuatorSampling.H:138
void column_cell_ranges(const MultiFab &z_phys_nd, const Geometry &geom, const std::vector< Real > &pos, const std::vector< Real > &reach, ColumnCells &cells)
Definition: ERF_ActuatorSampling.cpp:636
bool region_touches_grids(const BoxArray &ba, const Geometry &geom, const RealBox &region, const ZBounds *zb)
Definition: ERF_ActuatorSampling.cpp:843
std::vector< Real > wrap_periodic(const std::vector< Real > &pos, const Geometry &geom)
Definition: ERF_ActuatorSampling.cpp:100
void terrain_heights(const MultiFab *z_phys_nd, const Geometry &geom, const std::vector< Real > &pos, std::vector< Real > &h)
Definition: ERF_ActuatorSampling.cpp:389
void check_same_points_everywhere(int npts, const char *who)
Abort, naming who, unless every rank passes the same number of points (one collective).
Definition: ERF_ActuatorSampling.cpp:88
Definition: ERF_ActuatorDeviceBuffers.H:61
Definition: ERF_ActuatorSampling.H:248
std::vector< int > kt
Definition: ERF_ActuatorSampling.H:249
ColumnCells slice(std::size_t begin, std::size_t n) const
Definition: ERF_ActuatorSampling.H:251
std::vector< int > kb
Definition: ERF_ActuatorSampling.H:249
Definition: ERF_ActuatorSampling.H:297
CoverageGrids(const amrex::BoxArray &ba, const amrex::Geometry &geom)
Definition: ERF_ActuatorSampling.cpp:736
amrex::BoxArray footprints
each box flattened onto the bottom layer (they may overlap)
Definition: ERF_ActuatorSampling.H:300
amrex::BoxArray cells
the boxes, cell-centered
Definition: ERF_ActuatorSampling.H:299
Definition: ERF_ActuatorSampling.H:146
int k0
the node level of node_lo[0] and the cell of has_cell[0]
Definition: ERF_ActuatorSampling.H:149
bool has_ground() const
Definition: ERF_ActuatorSampling.H:154
amrex::Real dz_lo
Definition: ERF_ActuatorSampling.H:147
std::vector< amrex::Real > node_hi
node level k0 + n: the lowest and highest height (empty: no table)
Definition: ERF_ActuatorSampling.H:150
amrex::Real ground_hi
Definition: ERF_ActuatorSampling.H:147
std::vector< char > has_cell
cell k0 + n is in one of the boxes
Definition: ERF_ActuatorSampling.H:151
void k_range(amrex::Real zl, amrex::Real zh, int klo, int khi, int &kb, int &kt) const
Definition: ERF_ActuatorSampling.H:167
amrex::Real dz_hi
Definition: ERF_ActuatorSampling.H:147
bool has_table() const
Definition: ERF_ActuatorSampling.H:157
amrex::Real ground_lo
Definition: ERF_ActuatorSampling.H:147
bool all_ground
every box of the level reaches the ground (else the bounds hold for those that do)
Definition: ERF_ActuatorSampling.H:148
std::vector< amrex::Real > node_lo
Definition: ERF_ActuatorSampling.H:150