35 explicit EGrid(
const std::string& filename, std::string grid_name =
"global");
37 int global_index(
int i,
int j,
int k)
const;
38 int active_index(
int i,
int j,
int k)
const;
40 const std::array<int, 3>& dimension()
const {
return nijk; }
42 std::array<int, 3> ijk_from_active_index(
int actInd)
const;
43 std::array<int, 3> ijk_from_global_index(
int globInd)
const;
45 void getCellCorners(
int globindex, std::array<double,8>& X, std::array<double,8>& Y, std::array<double,8>& Z);
46 void getCellCorners(
const std::array<int, 3>& ijk, std::array<double,8>& X, std::array<double,8>& Y, std::array<double,8>& Z);
48 std::vector<std::array<float, 3>> getXYZ_layer(
int layer,
bool bottom=
false);
49 std::vector<std::array<float, 3>> getXYZ_layer(
int layer,
const std::array<int, 4>& box,
bool bottom=
false);
51 int activeCells()
const {
return nactive; }
52 int totalNumberOfCells()
const {
return nijk[0] * nijk[1] * nijk[2]; }
54 void load_grid_data();
56 bool is_radial()
const {
return m_radial; }
58 const std::vector<int>& hostCellsGlobalIndex()
const {
return host_cells; }
59 std::vector<std::array<int, 3>> hostCellsIJK();
62 using NNCentry = std::tuple<int, int, int, int, int, int, float>;
63 std::vector<NNCentry> get_nnc_ijk();
65 const std::vector<std::string>& list_of_lgrs()
const {
return lgr_names; }
67 const std::vector<float>& get_mapaxes()
const {
return m_mapaxes; }
68 const std::string& get_mapunits()
const {
return m_mapunits; }
71 std::filesystem::path inputFileName, initFileName;
72 std::string m_grid_name;
75 std::vector<float> m_mapaxes;
76 std::string m_mapunits;
78 std::array<int, 3> nijk;
79 std::array<int, 3> host_nijk;
82 mutable bool m_nncs_loaded;
84 std::vector<int> act_index;
85 std::vector<int> glob_index;
87 std::vector<float> coord_array;
88 std::vector<float> zcorn_array;
90 std::vector<int> nnc1_array;
91 std::vector<int> nnc2_array;
92 std::vector<float> transnnc_array;
93 std::vector<int> host_cells;
94 std::map<int,int> res;
96 std::vector<std::string> lgr_names;
100 int zcorn_array_index;
101 int coord_array_index;
102 int coordsys_array_index;
103 int actnum_array_index;
104 int nnc1_array_index;
105 int nnc2_array_index;
107 std::vector<float> get_zcorn_from_disk(
int layer,
bool bottom);
109 void getCellCorners(
const std::array<int, 3>& ijk,
const std::vector<float>& zcorn_layer,
110 std::array<double,4>& X, std::array<double,4>& Y, std::array<double,4>& Z);