Block-Structured AMR Software Framework
AMReX_EBToPVD.H
Go to the documentation of this file.
1 #ifndef AMReX_EBToPVD_H_
2 #define AMReX_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 <vector>
9 #include <array>
10 #include <iosfwd>
11 
12 namespace amrex {
13 
14 class EBToPVD {
15 
16 public:
17  EBToPVD() = default;
18 
19  void EBToPolygon(const Real* problo, const Real* dx,
20  const Box & bx, Array4<EBCellFlag const> const& flag,
21  Array4<Real const> const& bcent,
22  Array4<Real const> const& apx, Array4<Real const> const& apy, Array4<Real const> const& apz);
23 
24  void WriteEBVTP(int myID) const;
25  static void WritePVTP(int nProcs) ;
26 
27  void EBGridCoverage(int myID, const Real* problo, const Real* dx,
28  const Box &bx, Array4<EBCellFlag const> const& flag);
29 
30 private:
31  void reorder_polygon(const std::vector<std::array<Real,3>>& lpoints, std::array<int,7>& lconnect,
32  const std::array<Real,3>& lnormal);
33 
34  // Calculates the Hesse Normal FOrm corresponding to normal and centroid
35  static void calc_hesse(Real& distance, std::array<Real,3>& n0, Real& p,
36  const std::array<Real,3>& normal, const std::array<Real,3>& centroid) ;
37 
38  // Fills the alpha vector
39  static void calc_alpha(std::array<Real,12>& alpha,
40  const std::array<Real,3>& n0, Real p,
41  const std::array<std::array<Real,3>,8>& vertex,
42  const Real* dx) ;
43 
44  // Fills count and flags selecting the alphas which are in (0,1)
45  static void calc_intersects(int& int_count, std::array<bool,12>& intersects_flags,
46  const std::array<Real,12>& alpha) ;
47 
48  void print_points(std::ofstream& myfile) const;
49  void print_connectivity(std::ofstream& myfile) const;
50  void print_grids(std::ofstream& myfile) const;
51 
52  std::vector<std::array<Real,3>> m_points;
53  std::vector<std::array<int,7>> m_connectivity;
54  int m_grid{0};
55 
56 };
57 
58 }
59 
60 #endif
Definition: AMReX_EBToPVD.H:14
void reorder_polygon(const std::vector< std::array< Real, 3 >> &lpoints, std::array< int, 7 > &lconnect, const std::array< Real, 3 > &lnormal)
Definition: AMReX_EBToPVD.cpp:240
static void calc_alpha(std::array< Real, 12 > &alpha, const std::array< Real, 3 > &n0, Real p, const std::array< std::array< Real, 3 >, 8 > &vertex, const Real *dx)
Definition: AMReX_EBToPVD.cpp:341
std::vector< std::array< Real, 3 > > m_points
Definition: AMReX_EBToPVD.H:52
int m_grid
Definition: AMReX_EBToPVD.H:54
void print_connectivity(std::ofstream &myfile) const
Definition: AMReX_EBToPVD.cpp:402
void print_grids(std::ofstream &myfile) const
static void calc_hesse(Real &distance, std::array< Real, 3 > &n0, Real &p, const std::array< Real, 3 > &normal, const std::array< Real, 3 > &centroid)
Definition: AMReX_EBToPVD.cpp:321
void WriteEBVTP(int myID) const
Definition: AMReX_EBToPVD.cpp:187
void EBGridCoverage(int myID, const Real *problo, const Real *dx, const Box &bx, Array4< EBCellFlag const > const &flag)
Definition: AMReX_EBToPVD.cpp:426
static void WritePVTP(int nProcs)
Definition: AMReX_EBToPVD.cpp:214
std::vector< std::array< int, 7 > > m_connectivity
Definition: AMReX_EBToPVD.H:53
void EBToPolygon(const Real *problo, const Real *dx, const Box &bx, Array4< EBCellFlag const > const &flag, Array4< Real const > const &bcent, Array4< Real const > const &apx, Array4< Real const > const &apy, Array4< Real const > const &apz)
Definition: AMReX_EBToPVD.cpp:27
static void calc_intersects(int &int_count, std::array< bool, 12 > &intersects_flags, const std::array< Real, 12 > &alpha)
Definition: AMReX_EBToPVD.cpp:374
EBToPVD()=default
void print_points(std::ofstream &myfile) const
Definition: AMReX_EBToPVD.cpp:388
Definition: AMReX_Amr.cpp:49
Definition: AMReX_Array4.H:61