ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_FireGrid.H File Reference

Fire grid data structure and construction. More...

#include <ERF_SurfaceGrid.H>
#include <AMReX_BoxArray.H>
#include <AMReX_DistributionMapping.H>
#include <AMReX_Geometry.H>
#include <AMReX_MultiFab.H>
Include dependency graph for ERF_FireGrid.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FireGrid
 2D horizontal fire computational grid More...
 

Functions

const SurfaceCouplingNames & fire_coupling_names ()
 The fire coupling's names: erf.fire.<key>, "[FIRE]", "fire grid". More...
 
FireGrid create_fire_grid (const amrex::BoxArray &ba_atm, const amrex::DistributionMapping &dm_atm, const amrex::Geometry &geom_atm, int C)
 Construct a refined 2D fire grid over one atmospheric level's boxes. More...
 
void fire_fill_boundary (amrex::MultiFab &mf, const amrex::Geometry &geom)
 
void fill_fire_from_atm_k0 (amrex::MultiFab &fire_mf, const amrex::MultiFab &atm_k0, const FireGrid &fg)
 

Detailed Description

Fire grid data structure and construction.

Defines a 2D grid for fire simulation on the horizontal plane, refined by factor C relative to one atmospheric AMR level (erf.fire.anchor_level, the finest level by default). The fire 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. It is the surface grid of the surface-coupling layer (ERF_SurfaceGrid.H) under the fire coupling's name; the functions below call that layer with the fire coupling's names.

Function Documentation

◆ create_fire_grid()

FireGrid create_fire_grid ( const amrex::BoxArray &  ba_atm,
const amrex::DistributionMapping &  dm_atm,
const amrex::Geometry &  geom_atm,
int  C 
)

Construct a refined 2D fire grid over one atmospheric level's boxes.

Parameters
[in]ba_atmBoxArray of the atmospheric level
[in]dm_atmDistributionMapping of the atmospheric level
[in]geom_atmGeometry of the atmospheric level
[in]CRefinement factor (erf.fire.grid_ratio)
Returns
FireGrid over the region the boxes cover; its lev is left at 0 for the caller to set. See create_surface_grid() for the algorithm.

◆ fill_fire_from_atm_k0()

void fill_fire_from_atm_k0 ( amrex::MultiFab &  fire_mf,
const amrex::MultiFab &  atm_k0,
const FireGrid &  fg 
)
inline

Copy a k = 0 atmospheric field onto the fire grid: every fire cell takes the value of the atmospheric column it lies in, (i / C + atm_lo[0], j / C + atm_lo[1]) (surface_fill_from_atm_k0). Box n of the fire grid refines box n of the atmospheric level and has the same owner, so one MFIter serves both MultiFabs.

86 {
87  surface_fill_from_atm_k0(fire_mf, atm_k0, fg, fire_coupling_names());
88 }
const SurfaceCouplingNames & fire_coupling_names()
The fire coupling's names: erf.fire.<key>, "[FIRE]", "fire grid".
Definition: ERF_FireGrid.H:25
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)
Definition: ERF_SurfaceGrid.H:170
@ fg
Definition: ERF_AdvanceMorrison.cpp:111
Here is the call graph for this function:

◆ fire_coupling_names()

const SurfaceCouplingNames& fire_coupling_names ( )
inline

The fire coupling's names: erf.fire.<key>, "[FIRE]", "fire grid".

26 {
27  static const SurfaceCouplingNames names{"fire", "Fire", "FIRE"};
28  return names;
29 }
Definition: ERF_SurfaceCouplingNames.H:18

Referenced by coarsen_fire_flux_to_atm(), create_fire_grid(), fill_fire_from_atm_k0(), fire_anchor_level(), fire_fill_boundary(), FireCouplingParams::read(), register_fire_engine(), verify_fire_precip_source(), and verify_fire_prerequisites().

Here is the caller graph for this function:

◆ fire_fill_boundary()

void fire_fill_boundary ( amrex::MultiFab &  mf,
const amrex::Geometry &  geom 
)
inline

Exchange the ghost cells of a fire-grid MultiFab and fill the ones outside a non-periodic face of the domain by copying the nearest interior value (surface_fill_boundary).

FillBoundary alone leaves those cells untouched, so with an inflow-outflow atmosphere (the fire grid inherits its periodicity) the gradient stencil of the level set read whatever the allocator had left there. Whether that was benign depended on the box layout: one box per rank happened to run, two boxes on a rank blew the level set up at the inflow face within three steps. Every fire-grid exchange goes through here.

74 {
76 }
void surface_fill_boundary(amrex::MultiFab &mf, const amrex::Geometry &geom, const SurfaceCouplingNames &names)
Definition: ERF_SurfaceGrid.H:130

Referenced by FireCoupler::read_checkpoint(), and FireCoupler::update_flux_buffer().

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