ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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  eb_ ();
24 
25  void define (int level,
26  amrex::Geometry const& a_geom,
27  amrex::EB2::Level const* a_eb_level,
28  bool is_anelastic);
29 
30  void make_factory ( int level,
31  amrex::Geometry const& a_geom,
32  amrex::BoxArray const& ba,
33  amrex::DistributionMapping const& dm,
34  amrex::EB2::Level const& a_eb_level);
35 
36  int nghost_basic () const { return 5; } // nghost_eb_basic ()
37  int nghost_volume () const { return 5; } // nghost_eb_volume ()
38  int nghost_full () const { return 4; } // nghost_eb_full ()
39 
40  const std::unique_ptr<amrex::EBFArrayBoxFactory>& get_const_factory () const noexcept { return m_factory; }
41 
42  void WriteEBSurface (const amrex::BoxArray & ba,
43  const amrex::DistributionMapping & dmap,
44  const amrex::Geometry & geom,
45  const amrex::EBFArrayBoxFactory * ebf,
46  const int level);
47 
48  eb_aux_ const* get_u_const_factory() const noexcept { return &m_u_factory; }
49  eb_aux_ const* get_v_const_factory() const noexcept { return &m_v_factory; }
50  eb_aux_ const* get_w_const_factory() const noexcept { return &m_w_factory; }
51 
52  class EBToPVD;
53 
54  private:
55 
56  int m_has_eb;
57  std::string m_type;
58 
59  amrex::EBSupport m_support_level;
60 
62 
63  amrex::FabArray<amrex::EBCellFlagFab>* m_cellflags = nullptr;
64 
65  //! EB level constructed from building GeometryShop
66  amrex::EB2::Level const* m_eb_level;
67 
68  std::unique_ptr<amrex::EBFArrayBoxFactory> m_factory;
69 
73 
74  void make_box (amrex::Geometry const& a_geom);
75  void make_terrain (amrex::Geometry const& a_geom);
76 
77  //! Construct EB levels from Geometry shop.
78  template<class F>
79  void build_level (amrex::Geometry const& a_geom,
80  amrex::EB2::GeometryShop<F> a_gshop)
81  {
82  int const req_lev(0);
83  int const max_lev(2);
84 
85  amrex::EB2::Build(a_gshop, a_geom, req_lev, max_lev);
86  const amrex::EB2::IndexSpace& ebis = amrex::EB2::IndexSpace::top();
87  m_eb_level = &(ebis.getLevel(a_geom));
88  }
89 
90 };
91 #endif
Definition: ERF_EB.H:13
eb_()
Definition: ERF_EB.cpp:26
void define(int level, amrex::Geometry const &a_geom, amrex::EB2::Level const *a_eb_level, bool is_anelastic)
void make_terrain(amrex::Geometry const &a_geom)
eb_aux_ const * get_w_const_factory() const noexcept
Definition: ERF_EB.H:50
void build_level(amrex::Geometry const &a_geom, amrex::EB2::GeometryShop< F > a_gshop)
Construct EB levels from Geometry shop.
Definition: ERF_EB.H:79
void WriteEBSurface(const amrex::BoxArray &ba, const amrex::DistributionMapping &dmap, const amrex::Geometry &geom, const amrex::EBFArrayBoxFactory *ebf, const int level)
Definition: ERF_EB.cpp:77
amrex::EB2::Level const * m_eb_level
EB level constructed from building GeometryShop.
Definition: ERF_EB.H:66
amrex::FabArray< amrex::EBCellFlagFab > * m_cellflags
Definition: ERF_EB.H:63
const std::unique_ptr< amrex::EBFArrayBoxFactory > & get_const_factory() const noexcept
Definition: ERF_EB.H:40
eb_aux_ m_w_factory
Definition: ERF_EB.H:72
std::unique_ptr< amrex::EBFArrayBoxFactory > m_factory
Definition: ERF_EB.H:68
amrex::EBSupport m_support_level
Definition: ERF_EB.H:59
int nghost_volume() const
Definition: ERF_EB.H:37
void make_factory(int level, amrex::Geometry const &a_geom, amrex::BoxArray const &ba, amrex::DistributionMapping const &dm, amrex::EB2::Level const &a_eb_level)
Definition: ERF_EB.cpp:33
eb_aux_ m_u_factory
Definition: ERF_EB.H:70
~eb_()
Definition: ERF_EB.cpp:21
eb_(amrex::Geometry const &a_geom, amrex::FArrayBox const &terrain_fab, amrex::Gpu::DeviceVector< amrex::Real > &a_dz_stretched, bool is_anelastic)
eb_aux_ const * get_v_const_factory() const noexcept
Definition: ERF_EB.H:49
eb_aux_ m_v_factory
Definition: ERF_EB.H:71
int m_has_eb
Definition: ERF_EB.H:52
int nghost_full() const
Definition: ERF_EB.H:38
int nghost_basic() const
Definition: ERF_EB.H:36
int m_write_eb_surface
Definition: ERF_EB.H:61
void make_box(amrex::Geometry const &a_geom)
Definition: ERF_EBBox.cpp:22
eb_aux_ const * get_u_const_factory() const noexcept
Definition: ERF_EB.H:48
std::string m_type
Definition: ERF_EB.H:57
Definition: ERF_EBAux.H:12