ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_EBAux.H
Go to the documentation of this file.
1 /**
2  * \file ERF_EBAux.H
3  * \brief Declares auxiliary EB factories for face-centered data.
4  */
5 #ifndef ERF_EB_AUX_H_
6 #define ERF_EB_AUX_H_
7 
8 #include <AMReX_Geometry.H>
9 #include <AMReX_DistributionMapping.H>
10 #include <AMReX_BoxArray.H>
11 
12 #include <AMReX_EB2.H>
13 #include <AMReX_EBFabFactory.H>
14 
15 /**
16  * \brief Stores face-centered EB geometry reconstructed from a cell-centered factory.
17  *
18  * This class mirrors the subset of the AMReX EB factory interface needed by ERF
19  * staggered momentum fields when native face-centered EB factories are disabled.
20  */
21 class eb_aux_
22 {
23  public:
24 
25  //! Construct an undefined auxiliary EB factory.
26  eb_aux_ ();
27  //! Destroy the auxiliary EB factory.
28  ~eb_aux_ ();
29 
30  /**
31  * \brief Define face-centered EB geometry for one staggered direction.
32  * \param a_level AMR level index.
33  * \param a_idim Staggered direction for the target velocity grid.
34  * \param a_geom Cell-centered level geometry.
35  * \param a_grids Cell-centered grid boxes.
36  * \param a_dmap Distribution mapping for the grids.
37  * \param a_ngrow Ghost-cell counts for flags, volumes, and centroids.
38  * \param a_factory Source cell-centered EB factory.
39  */
40  void define ( int const& a_level,
41  int const& a_idim,
42  amrex::Geometry const& a_geom,
43  amrex::BoxArray const& a_grids,
44  amrex::DistributionMapping const& a_dmap,
45  amrex::Vector<int> const& a_ngrow,
46  amrex::EBFArrayBoxFactory const* a_factory);
47 
48  //! Enable verbose diagnostic output during factory construction.
49  void set_verbose ( ) { m_verbose = 1; }
50 
51  //! Return the reconstructed EB cell flags.
52  [[nodiscard]] const amrex::FabArray<amrex::EBCellFlagFab>& getMultiEBCellFlagFab () const;
53  //! Return the reconstructed volume fractions.
54  [[nodiscard]] const amrex::MultiFab& getVolFrac () const;
55  //! Return the reconstructed volume centroids.
56  [[nodiscard]] const amrex::MultiFab& getCentroid () const;
57  //! Return the reconstructed EB boundary areas.
58  [[nodiscard]] const amrex::MultiFab& getBndryArea () const;
59  //! Return the reconstructed EB boundary centroids.
60  [[nodiscard]] const amrex::MultiFab& getBndryCent () const;
61  //! Return the reconstructed EB boundary normals.
62  [[nodiscard]] const amrex::MultiFab& getBndryNormal () const;
63 
64  //! Return reconstructed area fractions for all coordinate directions.
65  [[nodiscard]] amrex::Array<const amrex::MultiFab*, AMREX_SPACEDIM> getAreaFrac () const;
66  //! Return reconstructed face centroids for all coordinate directions.
67  [[nodiscard]] amrex::Array<const amrex::MultiFab*, AMREX_SPACEDIM> getFaceCent () const;
68 
69  private:
70 
71  int m_verbose;
72 
73  // int m_defined;
74 
75  amrex::FabArray<amrex::EBCellFlagFab>* m_cellflags = nullptr;
76  amrex::MultiFab* m_volfrac = nullptr;
77  amrex::MultiFab* m_volcent = nullptr;
78  amrex::MultiFab* m_bndryarea = nullptr;
79  amrex::MultiFab* m_bndrycent = nullptr;
80  amrex::MultiFab* m_bndrynorm = nullptr;
81 
82  amrex::Array<amrex::MultiFab*,AMREX_SPACEDIM> m_areafrac {{AMREX_D_DECL(nullptr, nullptr, nullptr)}};
83  amrex::Array<amrex::MultiFab*,AMREX_SPACEDIM> m_facecent {{AMREX_D_DECL(nullptr, nullptr, nullptr)}};
84  // amrex::Array<amrex::MultiCutFab*,AMREX_SPACEDIM> m_edgecent {{AMREX_D_DECL(nullptr, nullptr, nullptr)}};
85 
86 };
87 
88 #endif
Stores face-centered EB geometry reconstructed from a cell-centered factory.
Definition: ERF_EBAux.H:22
const amrex::MultiFab & getBndryCent() const
Return the reconstructed EB boundary centroids.
Definition: ERF_EBAux.cpp:1177
amrex::Array< const amrex::MultiFab *, AMREX_SPACEDIM > getAreaFrac() const
Return reconstructed area fractions for all coordinate directions.
Definition: ERF_EBAux.cpp:1191
eb_aux_()
Construct an undefined auxiliary EB factory.
Definition: ERF_EBAux.cpp:22
amrex::Array< const amrex::MultiFab *, AMREX_SPACEDIM > getFaceCent() const
Return reconstructed face centroids for all coordinate directions.
Definition: ERF_EBAux.cpp:1198
const amrex::MultiFab & getBndryNormal() const
Return the reconstructed EB boundary normals.
Definition: ERF_EBAux.cpp:1184
~eb_aux_()
Destroy the auxiliary EB factory.
Definition: ERF_EBAux.cpp:17
void define(int const &a_level, int const &a_idim, amrex::Geometry const &a_geom, amrex::BoxArray const &a_grids, amrex::DistributionMapping const &a_dmap, amrex::Vector< int > const &a_ngrow, amrex::EBFArrayBoxFactory const *a_factory)
Define face-centered EB geometry for one staggered direction.
Definition: ERF_EBAux.cpp:29
amrex::FabArray< amrex::EBCellFlagFab > * m_cellflags
Definition: ERF_EBAux.H:75
amrex::MultiFab * m_bndrynorm
Definition: ERF_EBAux.H:80
void set_verbose()
Enable verbose diagnostic output during factory construction.
Definition: ERF_EBAux.H:49
int m_verbose
Definition: ERF_EBAux.H:71
amrex::MultiFab * m_bndryarea
Definition: ERF_EBAux.H:78
const amrex::MultiFab & getVolFrac() const
Return the reconstructed volume fractions.
Definition: ERF_EBAux.cpp:1156
amrex::MultiFab * m_volfrac
Definition: ERF_EBAux.H:76
const amrex::MultiFab & getBndryArea() const
Return the reconstructed EB boundary areas.
Definition: ERF_EBAux.cpp:1170
amrex::MultiFab * m_bndrycent
Definition: ERF_EBAux.H:79
const amrex::FabArray< amrex::EBCellFlagFab > & getMultiEBCellFlagFab() const
Return the reconstructed EB cell flags.
Definition: ERF_EBAux.cpp:1149
amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > m_facecent
Definition: ERF_EBAux.H:83
amrex::MultiFab * m_volcent
Definition: ERF_EBAux.H:77
amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > m_areafrac
Definition: ERF_EBAux.H:82
const amrex::MultiFab & getCentroid() const
Return the reconstructed volume centroids.
Definition: ERF_EBAux.cpp:1163