forked from AMReX-Codes/amrex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAMReX_EBToPVD.H
60 lines (44 loc) · 1.81 KB
/
AMReX_EBToPVD.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef AMReX_EBToPVD_H_
#define AMReX_EBToPVD_H_
#include <AMReX_Config.H>
#include <AMReX_EBCellFlag.H>
#include <AMReX_Array.H>
#include <AMReX_Box.H>
#include <vector>
#include <array>
#include <iosfwd>
namespace amrex {
class EBToPVD {
public:
EBToPVD(): m_grid(0) {}
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);
void WriteEBVTP(const int myID) const;
void WritePVTP(const int nProcs) const;
void EBGridCoverage(const int myID, const Real* problo, const Real* dx,
const Box &bx, Array4<EBCellFlag const> const& flag);
private:
void reorder_polygon(const std::vector<std::array<Real,3>>& lpoints, std::array<int,7>& lconnect,
const std::array<Real,3>& lnormal);
// Calculates the Hesse Normal FOrm corresponding to normal and centroid
void calc_hesse(Real& distance, std::array<Real,3>& n0, Real& p,
const std::array<Real,3>& normal, const std::array<Real,3>& centroid) const;
// Fills the alpha vector
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) const;
// Fills count and flags selecting the alphas which are in (0,1)
void calc_intersects(int& int_count, std::array<bool,12>& intersects_flags,
const std::array<Real,12>& alpha) const;
void print_points(std::ofstream& myfile) const;
void print_connectivity(std::ofstream& myfile) const;
void print_grids(std::ofstream& myfile) const;
std::vector<std::array<Real,3>> m_points;
std::vector<std::array<int,7>> m_connectivity;
int m_grid;
};
}
#endif