REMORA
Energy Research and Forecasting: An Atmospheric Modeling Code
REMORA_PhysBCFunct.H
Go to the documentation of this file.
1 #ifndef REMORA_PhysBCFunct_H_
2 #define REMORA_PhysBCFunct_H_
3 #include <AMReX_Config.H>
4 
5 #include <AMReX_BCRec.H>
6 #include <AMReX_Geometry.H>
7 #include <AMReX_MultiFab.H>
8 #include <AMReX_ArrayLim.H>
9 #include <AMReX_FilCC_C.H>
10 #include <AMReX_FilND_C.H>
11 #include <AMReX_FilFC_C.H>
12 #include "AMReX_TypeTraits.H"
13 #include "AMReX_Orientation.H"
14 
15 #include <TimeInterpolatedData.H>
16 #include <IndexDefines.H>
17 #include <DataStruct.H>
18 
19 using PlaneVector = amrex::Vector<amrex::FArrayBox>;
20 
21 struct NullFill
22 {
23  AMREX_GPU_DEVICE
24  void operator() (amrex::Array4<amrex::Real> const& /*dest*/,
25  const int /*dcomp*/, const int /*numcomp*/,
26  amrex::GeometryData const& /*geom*/, const amrex::Real /*time*/,
27  const amrex::BCRec* /*bcr*/, const int /*bcomp*/,
28  const int /*orig_comp*/) const
29  {
30  }
31 };
32 
34 {
35 public:
36  REMORAPhysBCFunct (const int lev,
37  const amrex::Geometry& geom, const amrex::Vector<amrex::BCRec>& domain_bcs_type,
38  const amrex::Gpu::DeviceVector<amrex::BCRec>& domain_bcs_type_d,
39  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NCONS> bc_extdir_vals
40  )
41  : m_lev(lev), m_geom(geom), m_domain_bcs_type(domain_bcs_type),
42  m_domain_bcs_type_d(domain_bcs_type_d),
43  m_bc_extdir_vals(bc_extdir_vals)
44  {}
45 
47 
48  //
49  // mf is the multifab to be filled
50  // icomp is the index into the MultiFab -- if cell-centered this can be any value
51  // from 0 to NCONS-1, if face-centered this must be 0
52  // ncomp is the number of components -- if cell-centered this can be any value
53  // from 1 to NCONS as long as icomp+ncomp <= NCONS-1. If face-centered this
54  // must be 1
55  // nghost is how many ghost cells to be filled
56  // time is the time at which the data should be filled
57  // bccomp is the index into both domain_bcs_type_bcr and bc_extdir_vals for icomp = 0 --
58  // so this follows the BCVars enum
59  //
60  void operator() (amrex::MultiFab& mf, int icomp, int ncomp, amrex::IntVect const& nghost,
61  amrex::Real time, int bccomp);
62 
63  void impose_xvel_bcs (const amrex::Array4<amrex::Real>& dest_arr, const amrex::Box& bx, const amrex::Box& domain,
64  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dxInv,
65  amrex::Real time, int bccomp);
66 
67  void impose_yvel_bcs (const amrex::Array4<amrex::Real>& dest_arr, const amrex::Box& bx, const amrex::Box& domain,
68  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dxInv,
69  amrex::Real time, int bccomp);
70 
71 
72  void impose_zvel_bcs (const amrex::Array4<amrex::Real>& dest_arr,
73  const amrex::Box& bx, const amrex::Box& domain,
74  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dx,
75  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dxInv,
76  amrex::Real time, int bccomp);
77 
78  void impose_cons_bcs (const amrex::Array4<amrex::Real>& mf, const amrex::Box& bx, const amrex::Box& domain,
79  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dxInv,
80  int icomp, int ncomp, amrex::Real time, int bccomp);
81 
82  // For backward compatibility
83  // void FillBoundary (amrex::MultiFab& mf, int dcomp, int ncomp, amrex::IntVect const& nghost,
84  // amrex::Real time, int bccomp) {
85  // this->operator()(mf,dcomp,ncomp,nghost,time,bccomp);
86  // }
87 
88 private:
89  int m_lev;
90  amrex::Geometry m_geom;
91  amrex::Vector<amrex::BCRec> m_domain_bcs_type;
92  amrex::Gpu::DeviceVector<amrex::BCRec> m_domain_bcs_type_d;
93  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NCONS> m_bc_extdir_vals;
94 };
95 
96 #endif
#define NCONS
Definition: IndexDefines.H:11
amrex::Vector< amrex::FArrayBox > PlaneVector
Definition: REMORA_PhysBCFunct.H:19
Definition: REMORA_PhysBCFunct.H:34
int m_lev
Definition: REMORA_PhysBCFunct.H:89
void impose_zvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Box &bx, const amrex::Box &domain, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dx, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, amrex::Real time, int bccomp)
Definition: BoundaryConditions_zvel.cpp:13
void impose_cons_bcs(const amrex::Array4< amrex::Real > &mf, const amrex::Box &bx, const amrex::Box &domain, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, int icomp, int ncomp, amrex::Real time, int bccomp)
Definition: BoundaryConditions_cons.cpp:17
~REMORAPhysBCFunct()
Definition: REMORA_PhysBCFunct.H:46
amrex::Vector< amrex::BCRec > m_domain_bcs_type
Definition: REMORA_PhysBCFunct.H:91
void impose_xvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Box &bx, const amrex::Box &domain, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, amrex::Real time, int bccomp)
Definition: BoundaryConditions_xvel.cpp:12
void impose_yvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Box &bx, const amrex::Box &domain, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, amrex::Real time, int bccomp)
Definition: BoundaryConditions_yvel.cpp:12
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NCONS > m_bc_extdir_vals
Definition: REMORA_PhysBCFunct.H:93
amrex::Geometry m_geom
Definition: REMORA_PhysBCFunct.H:90
void operator()(amrex::MultiFab &mf, int icomp, int ncomp, amrex::IntVect const &nghost, amrex::Real time, int bccomp)
Definition: REMORA_PhysBCFunct.cpp:19
amrex::Gpu::DeviceVector< amrex::BCRec > m_domain_bcs_type_d
Definition: REMORA_PhysBCFunct.H:92
REMORAPhysBCFunct(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+NCONS > bc_extdir_vals)
Definition: REMORA_PhysBCFunct.H:36
Definition: REMORA_PhysBCFunct.H:22
AMREX_GPU_DEVICE void operator()(amrex::Array4< amrex::Real > const &, const int, const int, amrex::GeometryData const &, const amrex::Real, const amrex::BCRec *, const int, const int) const
Definition: REMORA_PhysBCFunct.H:24