ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_EBToPVD.H
Go to the documentation of this file.
1 #ifndef ERF_EBToPVD_H_
2 #define ERF_EBToPVD_H_
3 #include <AMReX_Config.H>
4 #include <AMReX_EBCellFlag.H>
5 #include <AMReX_Array.H>
6 #include <AMReX_Box.H>
7 
8 #include <ERF_EB.H>
9 
10 #include <vector>
11 #include <array>
12 #include <iosfwd>
13 
14 using namespace amrex;
15 
16 class eb_::EBToPVD {
17 
18 public:
19  EBToPVD() = default;
20 
21  void EBToPolygon(const Real* problo, const Real* dx,
22  const Box & bx, Array4<EBCellFlag const> const& flag,
23  Array4<Real const> const& bcent,
24  Array4<Real const> const& apx, Array4<Real const> const& apy, Array4<Real const> const& apz);
25 
26  void WriteEBVTP(int myID) const;
27  static void WritePVTP(int nProcs) ;
28 
29  void EBGridCoverage(int myID, const Real* problo, const Real* dx,
30  const Box &bx, Array4<EBCellFlag const> const& flag);
31 
32 private:
33  void reorder_polygon(const std::vector<std::array<Real,3>>& lpoints, std::array<int,7>& lconnect,
34  const std::array<Real,3>& lnormal);
35 
36  // Calculates the Hesse Normal FOrm corresponding to normal and centroid
37  static void calc_hesse(Real& distance, std::array<Real,3>& n0, Real& p,
38  const std::array<Real,3>& normal, const std::array<Real,3>& centroid) ;
39 
40  // Fills the alpha vector
41  static void calc_alpha(std::array<Real,12>& alpha,
42  const std::array<Real,3>& n0, Real p,
43  const std::array<std::array<Real,3>,8>& vertex,
44  const Real* dx) ;
45 
46  // Fills count and flags selecting the alphas which are in (0,1)
47  static void calc_intersects(int& int_count, std::array<bool,12>& intersects_flags,
48  const std::array<Real,12>& alpha) ;
49 
50  void print_points(std::ofstream& myfile) const;
51  void print_connectivity(std::ofstream& myfile) const;
52  void print_grids(std::ofstream& myfile) const;
53 
54  std::vector<std::array<Real,3>> m_points;
55  std::vector<std::array<int,7>> m_connectivity;
56  int m_grid{0};
57 
58 };
59 
60 
61 #endif
Definition: ERF_EBToPVD.H:16
std::vector< std::array< Real, 3 > > m_points
Definition: ERF_EBToPVD.H:54
void print_grids(std::ofstream &myfile) const
std::vector< std::array< int, 7 > > m_connectivity
Definition: ERF_EBToPVD.H:55
EBToPVD()=default
Definition: ERF_ConsoleIO.cpp:12