ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_PhysBCFunct.H
Go to the documentation of this file.
1 #ifndef ERF_PhysBCFunct_H_
2 #define ERF_PhysBCFunct_H_
3 
4 #include <AMReX_Config.H>
5 
6 #include <AMReX_BCRec.H>
7 #include <AMReX_Geometry.H>
8 #include <AMReX_MultiFab.H>
9 #include <AMReX_ArrayLim.H>
10 #include <AMReX_FilCC_C.H>
11 #include <AMReX_FilND_C.H>
12 #include <AMReX_FilFC_C.H>
13 #include "AMReX_TypeTraits.H"
14 #include "AMReX_Orientation.H"
15 
16 #include <ERF_ReadBndryPlanes.H>
18 #include <ERF_IndexDefines.H>
19 #include <ERF_DataStruct.H>
20 #include <ERF_EddyViscosity.H>
21 #include <ERF_TerrainMetrics.H>
22 
24 {
25 public:
26  /**
27  * Construct the conserved-variable physical boundary-condition functor.
28  *
29  * @param[in] lev level index
30  * @param[in] geom geometry for the level
31  * @param[in] domain_bcs_type host boundary-condition records
32  * @param[in] domain_bcs_type_d device boundary-condition records
33  * @param[in] bc_extdir_vals external Dirichlet values for boundary faces
34  * @param[in] bc_neumann_vals Neumann values for boundary faces
35  * @param[in] z_phys_nd nodal physical height MultiFab
36  * @param[in] use_real_bcs whether real-data boundary conditions are active
37  * @param[in] th_bc_data optional theta boundary data
38  */
39  ERFPhysBCFunct_cons (const int lev,
40  const amrex::Geometry& geom, const amrex::Vector<amrex::BCRec>& domain_bcs_type,
41  const amrex::Gpu::DeviceVector<amrex::BCRec>& domain_bcs_type_d,
42  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_extdir_vals,
43  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_neumann_vals,
44  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
45  const bool use_real_bcs,
46  amrex::Real* th_bc_data)
47  : m_lev(lev), m_geom(geom),
48  m_domain_bcs_type(domain_bcs_type),
49  m_domain_bcs_type_d(domain_bcs_type_d),
50  m_bc_extdir_vals(bc_extdir_vals),
51  m_bc_neumann_vals(bc_neumann_vals),
52  m_z_phys_nd(z_phys_nd.get()),
53  m_use_real_bcs(use_real_bcs),
54  m_th_bc_data(th_bc_data)
55  {}
56 
57  /**
58  * Destroy the conserved-variable physical boundary-condition functor.
59  */
61 
62  /**
63  * Impose physical boundary conditions at domain boundaries
64  *
65  * @param[in,out] mf conserved-variable MultiFab to be filled
66  * @param[in] xvel x-velocity MultiFab used by upwind boundary conditions
67  * @param[in] yvel y-velocity MultiFab used by upwind boundary conditions
68  * @param[in] icomp starting component for conserved variables
69  * @param[in] ncomp number of components for conserved variables
70  * @param[in] nghost number of ghost cells to be filled for conserved variables
71  * @param[in] time time at which the data should be filled
72  * @param[in] bccomp_cons index into m_domain_bcs_type for conserved variables
73  * @param[in] do_fb whether to fill periodic/interior ghost cells first
74  * @param[in] do_terrain_adjustment whether to apply terrain-aware Neumann adjustments
75  */
76  void operator() (amrex::MultiFab& mf, amrex::MultiFab& xvel, amrex::MultiFab& yvel,
77  int icomp, int ncomp, amrex::IntVect const& nghost,
78  const double time, int bccomp_cons, bool do_fb = true, bool do_terrain_adjustment = true);
79 
80  /**
81  * Impose lateral boundary conditions on conserved variables.
82  *
83  * @param[in,out] dest_arr cell-centered data to be filled
84  * @param[in] xvel_arr x-velocity used to determine upwind inflow
85  * @param[in] yvel_arr y-velocity used to determine upwind inflow
86  * @param[in] bx box holding data to be filled
87  * @param[in] domain simulation domain
88  * @param[in] icomp starting component
89  * @param[in] ncomp number of components
90  * @param[in] ng number of ghost cells
91  * @param[in] time time at which data should be filled
92  */
93  void impose_lateral_cons_bcs (const amrex::Array4<amrex::Real>& dest_arr,
94  const amrex::Array4<amrex::Real const>& xvel_arr,
95  const amrex::Array4<amrex::Real const>& yvel_arr,
96  const amrex::Box& bx, const amrex::Box& domain,
97  int icomp, int ncomp, amrex::IntVect ng,
98  const double time);
99 
100  /**
101  * Impose vertical boundary conditions on conserved variables.
102  *
103  * @param[in,out] dest_arr cell-centered data to be filled
104  * @param[in] bx box holding data to be filled
105  * @param[in] domain simulation domain
106  * @param[in] z_nd nodal physical height
107  * @param[in] dxInv inverse cell size
108  * @param[in] icomp starting component
109  * @param[in] ncomp number of components
110  * @param[in] time time at which data should be filled
111  * @param[in] do_terrain_adjustment whether to apply terrain-aware Neumann adjustments
112  */
113  void impose_vertical_cons_bcs (const amrex::Array4<amrex::Real>& dest_arr,
114  const amrex::Box& bx, const amrex::Box& domain,
115  const amrex::Array4<amrex::Real const>& z_nd,
116  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dxInv,
117  int icomp, int ncomp, const double time,
118  bool do_terrain_adjustment = true);
119 
120 private:
121  int m_lev;
122  amrex::Geometry m_geom;
123  amrex::Vector<amrex::BCRec> m_domain_bcs_type;
124  amrex::Gpu::DeviceVector<amrex::BCRec> m_domain_bcs_type_d;
125  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_extdir_vals;
126  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_neumann_vals;
127  amrex::MultiFab* m_z_phys_nd;
130 };
131 
133 {
134 public:
135  /**
136  * Construct the x-velocity physical boundary-condition functor.
137  *
138  * @param[in] lev level index
139  * @param[in] geom geometry for the level
140  * @param[in] domain_bcs_type host boundary-condition records
141  * @param[in] domain_bcs_type_d device boundary-condition records
142  * @param[in] bc_extdir_vals external Dirichlet values for boundary faces
143  * @param[in] bc_neumann_vals Neumann values for boundary faces
144  * @param[in] z_phys_nd nodal physical height MultiFab
145  * @param[in] use_real_bcs whether real-data boundary conditions are active
146  * @param[in] u_bc_data optional x-velocity boundary data
147  */
148  ERFPhysBCFunct_u (const int lev, const amrex::Geometry& geom,
149  const amrex::Vector<amrex::BCRec>& domain_bcs_type,
150  const amrex::Gpu::DeviceVector<amrex::BCRec>& domain_bcs_type_d,
151  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_extdir_vals,
152  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_neumann_vals,
153  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
154  const bool use_real_bcs,
155  amrex::Real* u_bc_data)
156  : m_lev(lev), m_geom(geom),
157  m_domain_bcs_type(domain_bcs_type),
158  m_domain_bcs_type_d(domain_bcs_type_d),
159  m_bc_extdir_vals(bc_extdir_vals),
160  m_bc_neumann_vals(bc_neumann_vals),
161  m_z_phys_nd(z_phys_nd.get()),
162  m_use_real_bcs(use_real_bcs),
163  m_u_bc_data(u_bc_data)
164  { }
165 
166  /**
167  * Destroy the x-velocity physical boundary-condition functor.
168  */
170 
171  /**
172  * Impose physical boundary conditions at domain boundaries
173  *
174  * @param[in,out] mf x-velocity MultiFab to be filled
175  * @param[in] xvel x-velocity MultiFab used by upwind boundary conditions
176  * @param[in] yvel y-velocity MultiFab used by upwind boundary conditions
177  * @param[in] nghost number of ghost cells to be filled for velocity components
178  * @param[in] time time at which the data should be filled
179  * @param[in] bccomp index into m_domain_bcs_type
180  * @param[in] do_fb whether to fill periodic/interior ghost cells first
181  */
182  void operator() (amrex::MultiFab& mf, amrex::MultiFab& xvel, amrex::MultiFab& yvel,
183  amrex::IntVect const& nghost, const double time, int bccomp, bool do_fb);
184 
185  /**
186  * Impose lateral boundary conditions on x velocity.
187  *
188  * @param[in,out] dest_arr x-velocity data to be filled
189  * @param[in] xvel_arr x-velocity used to determine upwind inflow
190  * @param[in] yvel_arr y-velocity used to determine upwind inflow
191  * @param[in] bx box holding data to be filled
192  * @param[in] domain simulation domain
193  * @param[in] bccomp boundary-condition component
194  * @param[in] time time at which data should be filled
195  */
196  void impose_lateral_xvel_bcs (const amrex::Array4<amrex::Real>& dest_arr,
197  const amrex::Array4<amrex::Real const>& xvel_arr,
198  const amrex::Array4<amrex::Real const>& yvel_arr,
199  const amrex::Box& bx, const amrex::Box& domain,
200  int bccomp,
201  const double time);
202 
203  /**
204  * Impose vertical boundary conditions on x velocity.
205  *
206  * @param[in,out] dest_arr x-velocity data to be filled
207  * @param[in] bx box holding data to be filled
208  * @param[in] domain simulation domain
209  * @param[in] z_nd nodal physical height
210  * @param[in] dxInv inverse cell size
211  * @param[in] bccomp boundary-condition component
212  * @param[in] time time at which data should be filled
213  */
214  void impose_vertical_xvel_bcs (const amrex::Array4<amrex::Real>& dest_arr,
215  const amrex::Box& bx, const amrex::Box& domain,
216  const amrex::Array4<amrex::Real const>& z_nd,
217  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dxInv,
218  int bccomp,
219  const double time);
220 
221 private:
222  int m_lev;
223  amrex::Geometry m_geom;
224  amrex::Vector<amrex::BCRec> m_domain_bcs_type;
225  amrex::Gpu::DeviceVector<amrex::BCRec> m_domain_bcs_type_d;
226  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_extdir_vals;
227  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_neumann_vals;
228  amrex::MultiFab* m_z_phys_nd;
231 };
232 
234 {
235 public:
236  /**
237  * Construct the y-velocity physical boundary-condition functor.
238  *
239  * @param[in] lev level index
240  * @param[in] geom geometry for the level
241  * @param[in] domain_bcs_type host boundary-condition records
242  * @param[in] domain_bcs_type_d device boundary-condition records
243  * @param[in] bc_extdir_vals external Dirichlet values for boundary faces
244  * @param[in] bc_neumann_vals Neumann values for boundary faces
245  * @param[in] z_phys_nd nodal physical height MultiFab
246  * @param[in] use_real_bcs whether real-data boundary conditions are active
247  * @param[in] v_bc_data optional y-velocity boundary data
248  */
249  ERFPhysBCFunct_v (const int lev, const amrex::Geometry& geom,
250  const amrex::Vector<amrex::BCRec>& domain_bcs_type,
251  const amrex::Gpu::DeviceVector<amrex::BCRec>& domain_bcs_type_d,
252  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_extdir_vals,
253  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_neumann_vals,
254  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
255  const bool use_real_bcs,
256  amrex::Real* v_bc_data)
257  : m_lev(lev),
258  m_geom(geom), m_domain_bcs_type(domain_bcs_type),
259  m_domain_bcs_type_d(domain_bcs_type_d),
260  m_bc_extdir_vals(bc_extdir_vals),
261  m_bc_neumann_vals(bc_neumann_vals),
262  m_z_phys_nd(z_phys_nd.get()),
263  m_use_real_bcs(use_real_bcs),
264  m_v_bc_data(v_bc_data)
265  { }
266 
267  /**
268  * Destroy the y-velocity physical boundary-condition functor.
269  */
271 
272  /**
273  * Impose physical boundary conditions at domain boundaries
274  *
275  * @param[in,out] mf y-velocity MultiFab to be filled
276  * @param[in] xvel x-velocity MultiFab used by upwind boundary conditions
277  * @param[in] yvel y-velocity MultiFab used by upwind boundary conditions
278  * @param[in] nghost number of ghost cells to be filled for velocity components
279  * @param[in] time time at which the data should be filled
280  * @param[in] bccomp index into m_domain_bcs_type
281  * @param[in] do_fb whether to fill periodic/interior ghost cells first
282  */
283  void operator() (amrex::MultiFab& mf, amrex::MultiFab& xvel, amrex::MultiFab& yvel,
284  amrex::IntVect const& nghost, const double time, int bccomp, bool do_fb);
285 
286  /**
287  * Impose lateral boundary conditions on y velocity.
288  *
289  * @param[in,out] dest_arr y-velocity data to be filled
290  * @param[in] xvel_arr x-velocity used to determine upwind inflow
291  * @param[in] yvel_arr y-velocity used to determine upwind inflow
292  * @param[in] bx box holding data to be filled
293  * @param[in] domain simulation domain
294  * @param[in] bccomp boundary-condition component
295  * @param[in] time time at which data should be filled
296  */
297  void impose_lateral_yvel_bcs (const amrex::Array4<amrex::Real>& dest_arr,
298  const amrex::Array4<amrex::Real const>& xvel_arr,
299  const amrex::Array4<amrex::Real const>& yvel_arr,
300  const amrex::Box& bx, const amrex::Box& domain,
301  int bccomp,
302  const double time);
303 
304  /**
305  * Impose vertical boundary conditions on y velocity.
306  *
307  * @param[in,out] dest_arr y-velocity data to be filled
308  * @param[in] bx box holding data to be filled
309  * @param[in] domain simulation domain
310  * @param[in] z_nd nodal physical height
311  * @param[in] dxInv inverse cell size
312  * @param[in] bccomp boundary-condition component
313  * @param[in] time time at which data should be filled
314  */
315  void impose_vertical_yvel_bcs (const amrex::Array4<amrex::Real>& dest_arr,
316  const amrex::Box& bx, const amrex::Box& domain,
317  const amrex::Array4<amrex::Real const>& z_nd,
318  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dxInv,
319  int bccomp,
320  const double time);
321 
322 private:
323  int m_lev;
324  amrex::Geometry m_geom;
325  amrex::Vector<amrex::BCRec> m_domain_bcs_type;
326  amrex::Gpu::DeviceVector<amrex::BCRec> m_domain_bcs_type_d;
327  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_extdir_vals;
328  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_neumann_vals;
329  amrex::MultiFab* m_z_phys_nd;
332 };
333 
335 {
336 public:
337  /**
338  * Construct the z-velocity physical boundary-condition functor.
339  *
340  * @param[in] lev level index
341  * @param[in] geom geometry for the level
342  * @param[in] domain_bcs_type host boundary-condition records
343  * @param[in] domain_bcs_type_d device boundary-condition records
344  * @param[in] bc_extdir_vals external Dirichlet values for boundary faces
345  * @param[in] bc_neumann_vals Neumann values for boundary faces
346  * @param[in] terrain_type terrain type for the level
347  * @param[in] mapfac_lev map-factor MultiFabs for the level
348  * @param[in] z_phys_nd nodal physical height MultiFab
349  * @param[in] use_real_bcs whether real-data boundary conditions are active
350  * @param[in] w_bc_data optional z-velocity boundary data
351  */
352  ERFPhysBCFunct_w (const int lev, const amrex::Geometry& geom,
353  const amrex::Vector<amrex::BCRec>& domain_bcs_type,
354  const amrex::Gpu::DeviceVector<amrex::BCRec>& domain_bcs_type_d,
355  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_extdir_vals,
356  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_neumann_vals,
357  const TerrainType& terrain_type,
358  amrex::Vector<std::unique_ptr<amrex::MultiFab>>& mapfac_lev,
359  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
360  const bool use_real_bcs,
361  amrex::Real* w_bc_data)
362  : m_lev(lev),
363  m_geom(geom), m_domain_bcs_type(domain_bcs_type),
364  m_domain_bcs_type_d(domain_bcs_type_d),
365  m_bc_extdir_vals(bc_extdir_vals),
366  m_bc_neumann_vals(bc_neumann_vals),
367  m_terrain_type(terrain_type),
368  m_z_phys_nd(z_phys_nd.get()),
369  m_use_real_bcs(use_real_bcs),
370  m_w_bc_data(w_bc_data)
371  {
372  m_mapfac_u = mapfac_lev[MapFacType::u_x].get();
373  m_mapfac_v = mapfac_lev[MapFacType::v_y].get();
374  }
375 
376  /**
377  * Destroy the z-velocity physical boundary-condition functor.
378  */
380 
381  /**
382  * Impose physical boundary conditions at domain boundaries
383  *
384  * @param[in,out] mf z-velocity MultiFab to be filled
385  * @param[in] xvel x-velocity MultiFab used by upwind boundary conditions
386  * @param[in] yvel y-velocity MultiFab used by upwind boundary conditions
387  * @param[in] nghost number of ghost cells to be filled for velocity components
388  * @param[in] time time at which the data should be filled
389  * @param[in] bccomp index into m_domain_bcs_type for z velocity
390  * @param[in] do_fb whether to fill periodic/interior ghost cells first
391  */
392  void operator() (amrex::MultiFab& mf, amrex::MultiFab& xvel, amrex::MultiFab& yvel,
393  amrex::IntVect const& nghost, const double time, int bccomp,
394  bool do_fb);
395 
396  /**
397  * Impose lateral boundary conditions on z velocity.
398  *
399  * @param[in,out] dest_arr z-velocity data to be filled
400  * @param[in] xvel_arr x-velocity used to determine upwind inflow
401  * @param[in] yvel_arr y-velocity used to determine upwind inflow
402  * @param[in] bx box holding data to be filled
403  * @param[in] domain simulation domain
404  * @param[in] mf_u x map-factor field
405  * @param[in] mf_v y map-factor field
406  * @param[in] z_nd nodal physical height
407  * @param[in] dxInv inverse cell size
408  * @param[in] terrain_type terrain representation
409  * @param[in] bccomp boundary-condition component
410  * @param[in] time time at which data should be filled
411  */
412  void impose_lateral_zvel_bcs (const amrex::Array4<amrex::Real>& dest_arr,
413  const amrex::Array4<amrex::Real const>& xvel_arr,
414  const amrex::Array4<amrex::Real const>& yvel_arr,
415  const amrex::Box& bx, const amrex::Box& domain,
416  const amrex::Array4<amrex::Real const>& mf_u,
417  const amrex::Array4<amrex::Real const>& mf_v,
418  const amrex::Array4<amrex::Real const>& z_nd,
419  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dxInv,
420  TerrainType terrain_type, int bccomp,
421  const double time);
422 
423  /**
424  * Impose vertical boundary conditions on z velocity.
425  *
426  * @param[in,out] dest_arr z-velocity data to be filled
427  * @param[in] xvel_arr x-velocity used by terrain-aware vertical BCs
428  * @param[in] yvel_arr y-velocity used by terrain-aware vertical BCs
429  * @param[in] bx box holding data to be filled
430  * @param[in] domain simulation domain
431  * @param[in] mf_u x map-factor field
432  * @param[in] mf_v y map-factor field
433  * @param[in] z_nd nodal physical height
434  * @param[in] dxInv inverse cell size
435  * @param[in] bccomp_u x-velocity boundary-condition component
436  * @param[in] bccomp_v y-velocity boundary-condition component
437  * @param[in] bccomp_w z-velocity boundary-condition component
438  * @param[in] terrain_type terrain representation
439  * @param[in] time time at which data should be filled
440  */
441  void impose_vertical_zvel_bcs (const amrex::Array4<amrex::Real>& dest_arr,
442  const amrex::Array4<amrex::Real const>& xvel_arr,
443  const amrex::Array4<amrex::Real const>& yvel_arr,
444  const amrex::Box& bx, const amrex::Box& domain,
445  const amrex::Array4<amrex::Real const>& mf_u,
446  const amrex::Array4<amrex::Real const>& mf_v,
447  const amrex::Array4<amrex::Real const>& z_nd,
448  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dxInv,
449  int bccomp_u, int bccomp_v, int bccomp_w,
450  TerrainType terrain_type,
451  const double time);
452 
453 private:
454  int m_lev;
455  amrex::Geometry m_geom;
456  amrex::Vector<amrex::BCRec> m_domain_bcs_type;
457  amrex::Gpu::DeviceVector<amrex::BCRec> m_domain_bcs_type_d;
458  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_extdir_vals;
459  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_neumann_vals;
460  TerrainType m_terrain_type;
461  amrex::MultiFab* m_mapfac_u;
462  amrex::MultiFab* m_mapfac_v;
463  amrex::MultiFab* m_z_phys_nd;
466 };
467 
469 {
470 public:
471  /**
472  * Construct the base-state physical boundary-condition functor.
473  *
474  * @param[in] lev level index
475  * @param[in] geom geometry for the level
476  * @param[in] domain_bcs_type host boundary-condition records
477  * @param[in] domain_bcs_type_d device boundary-condition records
478  * @param[in] z_phys_nd nodal physical height MultiFab
479  * @param[in] moving_terrain whether moving terrain is active
480  */
481  ERFPhysBCFunct_base (const int lev,
482  const amrex::Geometry& geom, const amrex::Vector<amrex::BCRec>& domain_bcs_type,
483  const amrex::Gpu::DeviceVector<amrex::BCRec>& domain_bcs_type_d,
484  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
485  bool moving_terrain)
486  : m_lev(lev), m_geom(geom),
487  m_moving_terrain(moving_terrain),
488  m_domain_bcs_type(domain_bcs_type),
489  m_domain_bcs_type_d(domain_bcs_type_d),
490  m_z_phys_nd(z_phys_nd.get())
491  {}
492 
493  /**
494  * Destroy the base-state physical boundary-condition functor.
495  */
497 
498  /**
499  * Impose physical boundary conditions at domain boundaries
500  *
501  * @param[in,out] mf base-state MultiFab to be filled
502  * @param[in] icomp starting component for base-state variables
503  * @param[in] ncomp number of components for base-state variables
504  * @param[in] nghost number of ghost cells to be filled
505  */
506  void operator() (amrex::MultiFab& mf, int icomp, int ncomp, amrex::IntVect const& nghost);
507 
508  /**
509  * Impose lateral boundary conditions on base-state variables.
510  *
511  * @param[in,out] dest_arr base-state data to be filled
512  * @param[in] bx box holding data to be filled
513  * @param[in] domain simulation domain
514  * @param[in] ncomp number of components
515  * @param[in] nghost number of ghost cells to be filled
516  */
517  void impose_lateral_basestate_bcs (const amrex::Array4<amrex::Real>& dest_arr,
518  const amrex::Box& bx, const amrex::Box& domain,
519  int ncomp, const amrex::IntVect& nghost);
520 
521  /**
522  * Impose vertical boundary conditions on base-state variables.
523  *
524  * @param[in,out] dest_arr base-state data to be filled
525  * @param[in] z_nd nodal physical height
526  * @param[in] bx box holding data to be filled
527  * @param[in] domain simulation domain
528  * @param[in] ncomp number of components
529  * @param[in] nghost number of ghost cells to be filled
530  */
531  void impose_vertical_basestate_bcs (const amrex::Array4<amrex::Real>& dest_arr,
532  const amrex::Array4<amrex::Real const>& z_nd,
533  const amrex::Box& bx, const amrex::Box& domain,
534  int ncomp, const amrex::IntVect& nghost);
535 
536 private:
537  int m_lev;
538  amrex::Geometry m_geom;
540  amrex::Vector<amrex::BCRec> m_domain_bcs_type;
541  amrex::Gpu::DeviceVector<amrex::BCRec> m_domain_bcs_type_d;
542  amrex::MultiFab* m_z_phys_nd;
543 };
544 
545 #endif
@ v_y
Definition: ERF_DataStruct.H:28
@ u_x
Definition: ERF_DataStruct.H:27
#define NBCVAR_max
Definition: ERF_IndexDefines.H:29
amrex::GpuArray< Real, AMREX_SPACEDIM > dxInv
Definition: ERF_InitCustomPertVels_ParticleTests.H:17
pp get("wavelength", wavelength)
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Definition: ERF_PhysBCFunct.H:469
ERFPhysBCFunct_base(const int lev, const amrex::Geometry &geom, const amrex::Vector< amrex::BCRec > &domain_bcs_type, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, std::unique_ptr< amrex::MultiFab > &z_phys_nd, bool moving_terrain)
Definition: ERF_PhysBCFunct.H:481
amrex::Gpu::DeviceVector< amrex::BCRec > m_domain_bcs_type_d
Definition: ERF_PhysBCFunct.H:541
void impose_vertical_basestate_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &z_nd, const amrex::Box &bx, const amrex::Box &domain, int ncomp, const amrex::IntVect &nghost)
Definition: ERF_BoundaryConditionsBaseState.cpp:260
int m_lev
Definition: ERF_PhysBCFunct.H:537
amrex::MultiFab * m_z_phys_nd
Definition: ERF_PhysBCFunct.H:542
amrex::Geometry m_geom
Definition: ERF_PhysBCFunct.H:538
bool m_moving_terrain
Definition: ERF_PhysBCFunct.H:539
void impose_lateral_basestate_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Box &bx, const amrex::Box &domain, int ncomp, const amrex::IntVect &nghost)
Definition: ERF_BoundaryConditionsBaseState.cpp:18
void operator()(amrex::MultiFab &mf, int icomp, int ncomp, amrex::IntVect const &nghost)
Definition: ERF_PhysBCFunct.cpp:360
amrex::Vector< amrex::BCRec > m_domain_bcs_type
Definition: ERF_PhysBCFunct.H:540
~ERFPhysBCFunct_base()
Definition: ERF_PhysBCFunct.H:496
Definition: ERF_PhysBCFunct.H:24
bool m_use_real_bcs
Definition: ERF_PhysBCFunct.H:128
amrex::Geometry m_geom
Definition: ERF_PhysBCFunct.H:122
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
Definition: ERF_PhysBCFunct.H:125
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
Definition: ERF_PhysBCFunct.H:126
void operator()(amrex::MultiFab &mf, amrex::MultiFab &xvel, amrex::MultiFab &yvel, int icomp, int ncomp, amrex::IntVect const &nghost, const double time, int bccomp_cons, bool do_fb=true, bool do_terrain_adjustment=true)
Definition: ERF_PhysBCFunct.cpp:22
void impose_vertical_cons_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Box &bx, const amrex::Box &domain, const amrex::Array4< amrex::Real const > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, int icomp, int ncomp, const double time, bool do_terrain_adjustment=true)
Definition: ERF_BoundaryConditionsCons.cpp:329
void impose_lateral_cons_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &xvel_arr, const amrex::Array4< amrex::Real const > &yvel_arr, const amrex::Box &bx, const amrex::Box &domain, int icomp, int ncomp, amrex::IntVect ng, const double time)
Definition: ERF_BoundaryConditionsCons.cpp:22
amrex::Gpu::DeviceVector< amrex::BCRec > m_domain_bcs_type_d
Definition: ERF_PhysBCFunct.H:124
amrex::Vector< amrex::BCRec > m_domain_bcs_type
Definition: ERF_PhysBCFunct.H:123
~ERFPhysBCFunct_cons()
Definition: ERF_PhysBCFunct.H:60
amrex::Real * m_th_bc_data
Definition: ERF_PhysBCFunct.H:129
ERFPhysBCFunct_cons(const int lev, const amrex::Geometry &geom, const amrex::Vector< amrex::BCRec > &domain_bcs_type, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_extdir_vals, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_neumann_vals, std::unique_ptr< amrex::MultiFab > &z_phys_nd, const bool use_real_bcs, amrex::Real *th_bc_data)
Definition: ERF_PhysBCFunct.H:39
amrex::MultiFab * m_z_phys_nd
Definition: ERF_PhysBCFunct.H:127
int m_lev
Definition: ERF_PhysBCFunct.H:121
Definition: ERF_PhysBCFunct.H:133
ERFPhysBCFunct_u(const int lev, const amrex::Geometry &geom, const amrex::Vector< amrex::BCRec > &domain_bcs_type, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_extdir_vals, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_neumann_vals, std::unique_ptr< amrex::MultiFab > &z_phys_nd, const bool use_real_bcs, amrex::Real *u_bc_data)
Definition: ERF_PhysBCFunct.H:148
amrex::Geometry m_geom
Definition: ERF_PhysBCFunct.H:223
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
Definition: ERF_PhysBCFunct.H:226
amrex::Gpu::DeviceVector< amrex::BCRec > m_domain_bcs_type_d
Definition: ERF_PhysBCFunct.H:225
bool m_use_real_bcs
Definition: ERF_PhysBCFunct.H:229
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
Definition: ERF_PhysBCFunct.H:227
amrex::Real * m_u_bc_data
Definition: ERF_PhysBCFunct.H:230
void impose_vertical_xvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Box &bx, const amrex::Box &domain, const amrex::Array4< amrex::Real const > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, int bccomp, const double time)
Definition: ERF_BoundaryConditionsXvel.cpp:197
int m_lev
Definition: ERF_PhysBCFunct.H:222
void impose_lateral_xvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &xvel_arr, const amrex::Array4< amrex::Real const > &yvel_arr, const amrex::Box &bx, const amrex::Box &domain, int bccomp, const double time)
Definition: ERF_BoundaryConditionsXvel.cpp:18
amrex::Vector< amrex::BCRec > m_domain_bcs_type
Definition: ERF_PhysBCFunct.H:224
void operator()(amrex::MultiFab &mf, amrex::MultiFab &xvel, amrex::MultiFab &yvel, amrex::IntVect const &nghost, const double time, int bccomp, bool do_fb)
Definition: ERF_PhysBCFunct.cpp:104
~ERFPhysBCFunct_u()
Definition: ERF_PhysBCFunct.H:169
amrex::MultiFab * m_z_phys_nd
Definition: ERF_PhysBCFunct.H:228
Definition: ERF_PhysBCFunct.H:234
void impose_lateral_yvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &xvel_arr, const amrex::Array4< amrex::Real const > &yvel_arr, const amrex::Box &bx, const amrex::Box &domain, int bccomp, const double time)
Definition: ERF_BoundaryConditionsYvel.cpp:17
amrex::Geometry m_geom
Definition: ERF_PhysBCFunct.H:324
amrex::Gpu::DeviceVector< amrex::BCRec > m_domain_bcs_type_d
Definition: ERF_PhysBCFunct.H:326
void operator()(amrex::MultiFab &mf, amrex::MultiFab &xvel, amrex::MultiFab &yvel, amrex::IntVect const &nghost, const double time, int bccomp, bool do_fb)
Definition: ERF_PhysBCFunct.cpp:184
amrex::Real * m_v_bc_data
Definition: ERF_PhysBCFunct.H:331
int m_lev
Definition: ERF_PhysBCFunct.H:323
~ERFPhysBCFunct_v()
Definition: ERF_PhysBCFunct.H:270
ERFPhysBCFunct_v(const int lev, const amrex::Geometry &geom, const amrex::Vector< amrex::BCRec > &domain_bcs_type, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_extdir_vals, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_neumann_vals, std::unique_ptr< amrex::MultiFab > &z_phys_nd, const bool use_real_bcs, amrex::Real *v_bc_data)
Definition: ERF_PhysBCFunct.H:249
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
Definition: ERF_PhysBCFunct.H:328
void impose_vertical_yvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Box &bx, const amrex::Box &domain, const amrex::Array4< amrex::Real const > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, int bccomp, const double time)
Definition: ERF_BoundaryConditionsYvel.cpp:197
bool m_use_real_bcs
Definition: ERF_PhysBCFunct.H:330
amrex::Vector< amrex::BCRec > m_domain_bcs_type
Definition: ERF_PhysBCFunct.H:325
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
Definition: ERF_PhysBCFunct.H:327
amrex::MultiFab * m_z_phys_nd
Definition: ERF_PhysBCFunct.H:329
Definition: ERF_PhysBCFunct.H:335
amrex::Vector< amrex::BCRec > m_domain_bcs_type
Definition: ERF_PhysBCFunct.H:456
amrex::Geometry m_geom
Definition: ERF_PhysBCFunct.H:455
int m_lev
Definition: ERF_PhysBCFunct.H:454
amrex::Real * m_w_bc_data
Definition: ERF_PhysBCFunct.H:465
bool m_use_real_bcs
Definition: ERF_PhysBCFunct.H:464
amrex::Gpu::DeviceVector< amrex::BCRec > m_domain_bcs_type_d
Definition: ERF_PhysBCFunct.H:457
amrex::MultiFab * m_mapfac_v
Definition: ERF_PhysBCFunct.H:462
TerrainType m_terrain_type
Definition: ERF_PhysBCFunct.H:460
amrex::MultiFab * m_z_phys_nd
Definition: ERF_PhysBCFunct.H:463
amrex::MultiFab * m_mapfac_u
Definition: ERF_PhysBCFunct.H:461
void operator()(amrex::MultiFab &mf, amrex::MultiFab &xvel, amrex::MultiFab &yvel, amrex::IntVect const &nghost, const double time, int bccomp, bool do_fb)
Definition: ERF_PhysBCFunct.cpp:265
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
Definition: ERF_PhysBCFunct.H:459
ERFPhysBCFunct_w(const int lev, const amrex::Geometry &geom, const amrex::Vector< amrex::BCRec > &domain_bcs_type, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_extdir_vals, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_neumann_vals, const TerrainType &terrain_type, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &mapfac_lev, std::unique_ptr< amrex::MultiFab > &z_phys_nd, const bool use_real_bcs, amrex::Real *w_bc_data)
Definition: ERF_PhysBCFunct.H:352
~ERFPhysBCFunct_w()
Definition: ERF_PhysBCFunct.H:379
void impose_vertical_zvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &xvel_arr, const amrex::Array4< amrex::Real const > &yvel_arr, const amrex::Box &bx, const amrex::Box &domain, const amrex::Array4< amrex::Real const > &mf_u, const amrex::Array4< amrex::Real const > &mf_v, const amrex::Array4< amrex::Real const > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, int bccomp_u, int bccomp_v, int bccomp_w, TerrainType terrain_type, const double time)
Definition: ERF_BoundaryConditionsZvel.cpp:194
void impose_lateral_zvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &xvel_arr, const amrex::Array4< amrex::Real const > &yvel_arr, const amrex::Box &bx, const amrex::Box &domain, const amrex::Array4< amrex::Real const > &mf_u, const amrex::Array4< amrex::Real const > &mf_v, const amrex::Array4< amrex::Real const > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, TerrainType terrain_type, int bccomp, const double time)
Definition: ERF_BoundaryConditionsZvel.cpp:23
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
Definition: ERF_PhysBCFunct.H:458
@ ng
Definition: ERF_Morrison.H:49
@ xvel
Definition: ERF_IndexDefines.H:177
@ yvel
Definition: ERF_IndexDefines.H:178