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_all_factories ( 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  void make_cc_factory ( int level,
37  amrex::Geometry const& a_geom,
38  amrex::BoxArray const& ba,
39  amrex::DistributionMapping const& dm,
40  amrex::EB2::Level const& a_eb_level);
41 
42  int nghost_basic () const { return 5; } // nghost_eb_basic ()
43  int nghost_volume () const { return 5; } // nghost_eb_volume ()
44  int nghost_full () const { return 4; } // nghost_eb_full ()
45 
46  const std::unique_ptr<amrex::EBFArrayBoxFactory>& get_const_factory () const noexcept { return m_factory; }
47 
48  void WriteEBSurface (const amrex::BoxArray & ba,
49  const amrex::DistributionMapping & dmap,
50  const amrex::Geometry & geom,
51  const amrex::EBFArrayBoxFactory * ebf,
52  const int level);
53 
54  eb_aux_ const* get_u_const_factory() const noexcept { return &m_u_factory; }
55  eb_aux_ const* get_v_const_factory() const noexcept { return &m_v_factory; }
56  eb_aux_ const* get_w_const_factory() const noexcept { return &m_w_factory; }
57 
58  class EBToPVD;
59 
60  private:
61 
62  int m_has_eb;
63  std::string m_type;
64 
65  amrex::EBSupport m_support_level;
66 
68 
69  amrex::FabArray<amrex::EBCellFlagFab>* m_cellflags = nullptr;
70 
71  //! EB level constructed from building GeometryShop
72  amrex::EB2::Level const* m_eb_level;
73 
74  std::unique_ptr<amrex::EBFArrayBoxFactory> m_factory;
75 
79 
80  void make_box (amrex::Geometry const& a_geom);
81  void make_terrain (amrex::Geometry const& a_geom);
82 
83  //! Construct EB levels from Geometry shop.
84  template<class F>
85  void build_level (amrex::Geometry const& a_geom,
86  amrex::EB2::GeometryShop<F> a_gshop)
87  {
88  int const req_lev(0);
89  int const max_lev(2);
90 
91  amrex::EB2::Build(a_gshop, a_geom, req_lev, max_lev);
92  const amrex::EB2::IndexSpace& ebis = amrex::EB2::IndexSpace::top();
93  m_eb_level = &(ebis.getLevel(a_geom));
94  }
95 
96 };
97 #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:56
void build_level(amrex::Geometry const &a_geom, amrex::EB2::GeometryShop< F > a_gshop)
Construct EB levels from Geometry shop.
Definition: ERF_EB.H:85
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:94
amrex::EB2::Level const * m_eb_level
EB level constructed from building GeometryShop.
Definition: ERF_EB.H:72
void make_all_factories(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
amrex::FabArray< amrex::EBCellFlagFab > * m_cellflags
Definition: ERF_EB.H:69
const std::unique_ptr< amrex::EBFArrayBoxFactory > & get_const_factory() const noexcept
Definition: ERF_EB.H:46
eb_aux_ m_w_factory
Definition: ERF_EB.H:78
std::unique_ptr< amrex::EBFArrayBoxFactory > m_factory
Definition: ERF_EB.H:74
amrex::EBSupport m_support_level
Definition: ERF_EB.H:65
int nghost_volume() const
Definition: ERF_EB.H:43
void make_cc_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:74
eb_aux_ m_u_factory
Definition: ERF_EB.H:76
~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:55
eb_aux_ m_v_factory
Definition: ERF_EB.H:77
int m_has_eb
Definition: ERF_EB.H:58
int nghost_full() const
Definition: ERF_EB.H:44
int nghost_basic() const
Definition: ERF_EB.H:42
int m_write_eb_surface
Definition: ERF_EB.H:67
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:54
std::string m_type
Definition: ERF_EB.H:63
Definition: ERF_EBAux.H:12