16 (names.
tag() +
" Building the " + names.
grid() +
": " + names.
key(
"grid_ratio")
17 +
" must be >= 1").c_str());
24 Vector<Box> box_list_2d;
25 for (
int i = 0; i < ba_atm.size(); ++i) {
29 box_list_2d.push_back(b);
31 BoxList bl_2d(std::move(box_list_2d));
32 BoxArray ba_2d(bl_2d);
39 const Box region = ba_2d.minimalBox();
41 (names.
tag() +
" Building the " + names.
grid()
42 +
": the boxes of the atmospheric level do not form one rectangle").c_str());
43 const IntVect atm_lo(region.smallEnd(0), region.smallEnd(1), 0);
52 BoxArray ba_surf = ba_2d;
53 ba_surf.shift(-atm_lo);
54 ba_surf.refine(IntVect(C, C, 1));
62 const Box& dom_atm = geom_atm.Domain();
63 Box surf_domain(IntVect(0, 0, 0),
64 IntVect(region.length(0) * C - 1, region.length(1) * C - 1, 0));
66 Array<Real, AMREX_SPACEDIM>
lo {geom_atm.ProbLo(0), geom_atm.ProbLo(1), geom_atm.ProbLo(2)};
67 Array<Real, AMREX_SPACEDIM>
hi {geom_atm.ProbHi(0), geom_atm.ProbHi(1), geom_atm.ProbLo(2) + Real(1.0)};
68 Array<int, AMREX_SPACEDIM> is_per {0, 0, 0};
69 for (
int d = 0; d < 2; ++d) {
70 const bool spans = (region.smallEnd(d) == dom_atm.smallEnd(d)) && (region.bigEnd(d) == dom_atm.bigEnd(d));
72 lo[d] = geom_atm.ProbLo(d) + Real(region.smallEnd(d) - dom_atm.smallEnd(d)) * geom_atm.CellSize(d);
73 hi[d] = geom_atm.ProbLo(d) + Real(region.bigEnd(d) - dom_atm.smallEnd(d) + 1) * geom_atm.CellSize(d);
75 is_per[d] = (spans && geom_atm.isPeriodic(d)) ? 1 : 0;
77 RealBox prob_domain_2d(lo, hi);
81 sg.
geom =
Geometry(surf_domain, prob_domain_2d, CoordSys::cartesian, is_per);
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(axis >=0 &&axis< AMREX_SPACEDIM, "prob.axis must be 0, 1 or 2")
std::string tag() const
"[FIRE]"
Definition: ERF_SurfaceCouplingNames.H:24
std::string grid() const
"fire grid"
Definition: ERF_SurfaceCouplingNames.H:28
std::string key(const std::string &k) const
"erf.fire." followed by key
Definition: ERF_SurfaceCouplingNames.H:26
2D horizontal surface grid
Definition: ERF_SurfaceGrid.H:34
amrex::Geometry geom
2D Geometry in physical coordinates [m]
Definition: ERF_SurfaceGrid.H:37
amrex::IntVect atm_lo
Definition: ERF_SurfaceGrid.H:43
amrex::BoxArray ba
2D BoxArray (C*nx x C*ny x 1), box n refines atmospheric box n
Definition: ERF_SurfaceGrid.H:35
amrex::DistributionMapping dm
The atmospheric level's owners.
Definition: ERF_SurfaceGrid.H:36
int C
Definition: ERF_SurfaceGrid.H:38