ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_EB.H
Go to the documentation of this file.
1 #ifndef ERF_EB_H_
2 #define ERF_EB_H_
3 
4 #include <AMReX_Geometry.H>
5 #include <AMReX_DistributionMapping.H>
6 #include <AMReX_BoxArray.H>
7 
8 #include <AMReX_EB2.H>
9 #include <AMReX_EBFabFactory.H>
10 
11 #include <ERF_EBAux.H>
12 
13 class eb_ {
14 
15  public:
16 
17  ~eb_ ();
18 
19  eb_ (amrex::Geometry const& a_geom,
20  amrex::FArrayBox const& terrain_fab,
21  amrex::Gpu::DeviceVector<amrex::Real>& a_dz_stretched,
22  bool is_anelastic);
23 
24  void make_factory ( amrex::Geometry const& a_geom,
25  amrex::DistributionMapping const& a_dmap,
26  amrex::BoxArray const& a_grids);
27 
28  int nghost_basic () const { return 2; }
29  int nghost_volume () const { return 2; }
30  int nghost_full () const { return 2; }
31 
32  amrex::EBFArrayBoxFactory const* get_const_factory () noexcept
33  { return m_factory.get(); }
34 
35  amrex::EB2::Level const* get_level () const noexcept
36  { return m_eb_level; }
37 
38  private:
39 
40  int m_has_eb;
41  std::string m_type;
42 
43  amrex::EBSupport m_support_level;
44 
46 
47  //! EB level constructed from building GeometryShop
48  amrex::EB2::Level const* m_eb_level;
49 
50  std::unique_ptr<amrex::EBFArrayBoxFactory> m_factory;
51 
55 
56  void make_box (amrex::Geometry const& a_geom);
57  void make_terrain (amrex::Geometry const& a_geom);
58 
59  //! Construct EB levels from Geometry shop.
60  template<class F>
61  void build_level (amrex::Geometry const& a_geom,
62  amrex::EB2::GeometryShop<F> a_gshop)
63  {
64  int const req_lev(0);
65  int const max_lev(2);
66 
67  amrex::EB2::Build(a_gshop, a_geom, req_lev, max_lev);
68  const amrex::EB2::IndexSpace& ebis = amrex::EB2::IndexSpace::top();
69  m_eb_level = &(ebis.getLevel(a_geom));
70  }
71 
72 };
73 #endif
Definition: ERF_EB.H:13
void make_factory(amrex::Geometry const &a_geom, amrex::DistributionMapping const &a_dmap, amrex::BoxArray const &a_grids)
Definition: ERF_EB.cpp:63
void make_terrain(amrex::Geometry const &a_geom)
void build_level(amrex::Geometry const &a_geom, amrex::EB2::GeometryShop< F > a_gshop)
Construct EB levels from Geometry shop.
Definition: ERF_EB.H:61
amrex::EB2::Level const * m_eb_level
EB level constructed from building GeometryShop.
Definition: ERF_EB.H:48
eb_aux_ m_w_factory
Definition: ERF_EB.H:54
std::unique_ptr< amrex::EBFArrayBoxFactory > m_factory
Definition: ERF_EB.H:50
amrex::EBSupport m_support_level
Definition: ERF_EB.H:43
int nghost_volume() const
Definition: ERF_EB.H:29
eb_aux_ m_u_factory
Definition: ERF_EB.H:52
~eb_()
Definition: ERF_EB.cpp:12
eb_(amrex::Geometry const &a_geom, amrex::FArrayBox const &terrain_fab, amrex::Gpu::DeviceVector< amrex::Real > &a_dz_stretched, bool is_anelastic)
Definition: ERF_EB.cpp:17
amrex::EB2::Level const * get_level() const noexcept
Definition: ERF_EB.H:35
eb_aux_ m_v_factory
Definition: ERF_EB.H:53
amrex::EBFArrayBoxFactory const * get_const_factory() noexcept
Definition: ERF_EB.H:32
int m_has_eb
Definition: ERF_EB.H:40
int nghost_full() const
Definition: ERF_EB.H:30
int nghost_basic() const
Definition: ERF_EB.H:28
int m_write_eb_surface
Definition: ERF_EB.H:45
void make_box(amrex::Geometry const &a_geom)
Definition: ERF_EBBox.cpp:22
std::string m_type
Definition: ERF_EB.H:41
Definition: ERF_EBAux.H:12