|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
The 2D surface grid of the fire and flood couplings, and the maps between it and the atmospheric columns. More...
#include <ERF_SurfaceCouplingNames.H>#include <AMReX_BoxArray.H>#include <AMReX_DistributionMapping.H>#include <AMReX_Geometry.H>#include <AMReX_MultiFab.H>#include <AMReX_MFIter.H>

Go to the source code of this file.
Classes | |
| struct | SurfaceGrid |
| 2D horizontal surface grid More... | |
Functions | |
| SurfaceGrid | create_surface_grid (const amrex::BoxArray &ba_atm, const amrex::DistributionMapping &dm_atm, const amrex::Geometry &geom_atm, int C, const SurfaceCouplingNames &names) |
| Construct a refined 2D surface grid over one atmospheric level's boxes. More... | |
| bool | surface_same_columns (const amrex::BoxArray &a, const amrex::BoxArray &b) |
| bool | surface_pairs_with_atm (const amrex::MultiFab &surf_mf, const amrex::MultiFab &atm_mf, const SurfaceGrid &sg) |
| void | surface_fill_boundary (amrex::MultiFab &mf, const amrex::Geometry &geom, const SurfaceCouplingNames &names) |
| void | surface_fill_from_atm_k0 (amrex::MultiFab &surf_mf, const amrex::MultiFab &atm_k0, const SurfaceGrid &sg, const SurfaceCouplingNames &names, int scomp=0, int acomp=0) |
| void | surface_coarsen_to_atm (amrex::MultiFab &atm_out, const amrex::MultiFab &surf, const SurfaceGrid &sg, const SurfaceCouplingNames &names) |
The 2D surface grid of the fire and flood couplings, and the maps between it and the atmospheric columns.
A 2D grid on the horizontal plane, refined by C relative to one atmospheric AMR level (erf.fire.anchor_level or erf.flood.anchor_level, the finest level by default). The grid covers that level's boxes, keeps their x-y decomposition and their MPI owners, and its index space starts at zero at the lower corner of the region they cover. FireGrid (ERF_FireGrid.H) and FloodGrid (ERF_FloodGrid.H) are this grid under each coupling's name.
| SurfaceGrid create_surface_grid | ( | const amrex::BoxArray & | ba_atm, |
| const amrex::DistributionMapping & | dm_atm, | ||
| const amrex::Geometry & | geom_atm, | ||
| int | C, | ||
| const SurfaceCouplingNames & | names | ||
| ) |
Construct a refined 2D surface grid over one atmospheric level's boxes.
| [in] | ba_atm | BoxArray of the atmospheric level |
| [in] | dm_atm | DistributionMapping of the atmospheric level |
| [in] | geom_atm | Geometry of the atmospheric level |
| [in] | C | Refinement factor (>= 1, aborts otherwise) |
| [in] | names | The coupling's names, for the messages |
|
inline |
Average a surface-grid field over each atmospheric column (the C x C surface cells under it) into the k = 0 slabs of the grid's level: surface cells (i - lo_x) C + r, (j - lo_y) C + q for r, q in [0, C) average into atmospheric cell (i, j). Box n of the output is the k = 0 slab of atmospheric box n; an output box taller than one cell gets the average at every k of its valid region. On level 0, with k = 0 slabs, this is amrex::average_down() with ratio (C, C, 1), summed in the same order.
Referenced by coarsen_fire_flux_to_atm(), and coarsen_flood_to_atm().


|
inline |
Exchange the ghost cells of a cell-centred MultiFab on a surface grid (or on the atmospheric columns it covers) and fill the ones outside a non-periodic face of the domain by copying the nearest interior value.
FillBoundary alone leaves those cells untouched, so with an inflow-outflow atmosphere (the surface grid inherits its periodicity) a stencil that reads past the region's edge would read whatever the allocator had left there.
Referenced by fire_fill_boundary(), and flood_fill_boundary().


|
inline |
Copy component acomp of a k = 0 atmospheric field into component scomp of a surface-grid field: every surface cell takes the value of the atmospheric column it lies in, (i / C + atm_lo[0], j / C + atm_lo[1]). Box n of the surface grid refines box n of the atmospheric level and has the same owner, so one MFIter serves both MultiFabs. A per-area quantity (precipitation in kg/m2) keeps its column total: each of the C^2 cells under a column receives the column's value per unit area.
Referenced by fill_fire_from_atm_k0(), and fill_flood_from_atm_k0().


|
inline |
True when box n of the surface grid refines the columns of box n of the atmospheric level (shifted by -atm_lo, refined by {C, C, 1}) for every n, the two have the same owners, and both are cell-centred (the maps loop over the valid cells, so a nodal box would reach one column past its pair).
Referenced by flood_pairs_with_atm(), surface_coarsen_to_atm(), and surface_fill_from_atm_k0().

|
inline |
True when box n of a and box n of b cover the same columns (the same x-y extent) for every n; their z extents may differ.
Referenced by FireCoupler::fill_plot_var(), and flood_same_columns().
