68 double dx = 1.0,
double dy = 1.0,
double dz = 1.0,
73 const std::vector<double>& coord ,
74 const std::vector<double>& zcorn ,
75 const int * actnum =
nullptr);
82 static bool hasGDFILE(
const Deck& deck);
83 static bool hasRadialKeywords(
const Deck& deck);
84 static bool hasSpiderKeywords(
const Deck& deck);
85 static bool hasCylindricalKeywords(
const Deck& deck);
86 static bool hasCornerPointKeywords(
const Deck&);
87 static bool hasCartesianKeywords(
const Deck&);
88 size_t getNumActive( )
const;
89 bool allActive()
const;
91 size_t activeIndex(
size_t i,
size_t j,
size_t k)
const;
92 size_t activeIndex(
size_t globalIndex)
const;
94 size_t getActiveIndex(
size_t i,
size_t j,
size_t k)
const {
95 return activeIndex(i, j, k);
98 void save(
const std::string& filename,
bool formatted,
const std::vector<Opm::NNCdata>& nnc,
const Opm::UnitSystem& units)
const;
116 bool isPinchActive()
const;
117 double getPinchThresholdThickness()
const;
118 PinchMode getPinchOption()
const;
119 PinchMode getMultzOption()
const;
120 PinchMode getPinchGapMode()
const;
121 double getPinchMaxEmptyGap()
const;
123 MinpvMode getMinpvMode()
const;
124 const std::vector<double>& getMinpvVector( )
const;
140 std::vector<T> compressedVector(
const std::vector<T>& input_vector)
const {
141 if( input_vector.size() == this->getNumActive() ) {
145 if (input_vector.size() != getCartesianSize())
146 throw std::invalid_argument(
"Input vector must have full size");
149 std::vector<T> compressed_vector( this->getNumActive() );
152 for (
size_t i = 0; i < this->getNumActive(); ++i)
153 compressed_vector[i] = input_vector[ active_map[i] ];
155 return compressed_vector;
163 std::array<double, 3> getCellCenter(
size_t i,
size_t j,
size_t k)
const;
164 std::array<double, 3> getCellCenter(
size_t globalIndex)
const;
165 std::array<double, 3> getCornerPos(
size_t i,
size_t j,
size_t k,
size_t corner_index)
const;
166 const std::vector<double>& activeVolume()
const;
167 double getCellVolume(
size_t globalIndex)
const;
168 double getCellVolume(
size_t i ,
size_t j ,
size_t k)
const;
169 double getCellThickness(
size_t globalIndex)
const;
170 double getCellThickness(
size_t i ,
size_t j ,
size_t k)
const;
171 std::array<double, 3> getCellDims(
size_t i,
size_t j,
size_t k)
const;
172 std::array<double, 3> getCellDims(
size_t globalIndex)
const;
173 bool cellActive(
size_t globalIndex )
const;
174 bool cellActive(
size_t i ,
size_t j,
size_t k )
const;
176 std::array<double, 3> getCellDimensions(
size_t i,
size_t j,
size_t k)
const {
177 return getCellDims(i, j, k);
180 bool isCellActive(
size_t i,
size_t j,
size_t k)
const {
181 return cellActive(i, j, k);
192 double getCellDepth(
size_t i,
size_t j,
size_t k)
const;
193 double getCellDepth(
size_t globalIndex)
const;
196 const std::vector<double>& getCOORD()
const;
197 const std::vector<double>& getZCORN()
const;
198 const std::vector<int>& getACTNUM( )
const;
208 size_t getZcornFixed() {
return zcorn_fixed; };
213 void resetACTNUM(
const std::vector<int>& actnum);
216 void setMINPVV(
const std::vector<double>& minpvv);
219 static bool hasDVDEPTHZKeywords(
const Deck&);
228 static bool hasEqualDVDEPTHZ(
const Deck&);
229 static bool allEqual(
const std::vector<double> &v);
232 std::vector<double> m_minpvVector;
233 MinpvMode m_minpvMode;
234 std::optional<double> m_pinch;
235 PinchMode m_pinchoutMode;
236 PinchMode m_multzMode;
237 PinchMode m_pinchGapMode;
238 double m_pinchMaxEmptyGap;
240 mutable std::optional<std::vector<double>> active_volume;
242 bool m_circle =
false;
244 size_t zcorn_fixed = 0;
245 bool m_useActnumFromGdfile =
false;
248 mutable std::optional<std::vector<double>> m_input_zcorn;
249 mutable std::optional<std::vector<double>> m_input_coord;
251 std::vector<double> m_zcorn;
252 std::vector<double> m_coord;
255 std::vector<int> m_actnum;
256 std::optional<MapAxes> m_mapaxes;
260 std::vector<int> m_active_to_global;
261 std::vector<int> m_global_to_active;
263 std::unordered_set<size_t> m_aquifer_cells;
265 std::map<size_t, double> m_aquifer_cell_depths;
268 std::optional<std::vector<double>> m_thetav;
269 std::optional<std::vector<double>> m_rv;
271 void updateNumericalAquiferCells(
const Deck&);
272 double computeCellGeometricDepth(
size_t globalIndex)
const;
275 void resetACTNUM(
const int* actnum);
277 void initBinaryGrid(
const Deck& deck);
279 void initCornerPointGrid(
const std::vector<double>& coord ,
280 const std::vector<double>& zcorn ,
283 bool keywInputBeforeGdfile(
const Deck& deck,
const std::string& keyword)
const;
285 void initCylindricalGrid(
const Deck&);
286 void initSpiderwebGrid(
const Deck&);
287 void initSpiderwebOrCylindricalGrid(
const Deck&,
const bool);
288 void initCartesianGrid(
const Deck&);
289 void initDTOPSGrid(
const Deck&);
290 void initDVDEPTHZGrid(
const Deck&);
291 void initGrid(
const Deck&,
const int* actnum);
292 void initCornerPointGrid(
const Deck&);
293 void assertCornerPointKeywords(
const Deck&);
295 static bool hasDTOPSKeywords(
const Deck&);
296 static void assertVectorSize(
const std::vector<double>& vector,
size_t expectedSize,
const std::string& msg);
298 static std::vector<double> createTOPSVector(
const std::array<int, 3>& dims,
const std::vector<double>& DZ,
const Deck&);
299 static std::vector<double> createDVector(
const std::array<int, 3>& dims, std::size_t dim,
const std::string& DKey,
const std::string& DVKey,
const Deck&);
300 static void scatterDim(
const std::array<int, 3>& dims ,
size_t dim ,
const std::vector<double>& DV , std::vector<double>& D);
303 std::vector<double> makeCoordDxDyDzTops(
const std::vector<double>& dx,
const std::vector<double>& dy,
const std::vector<double>& dz,
const std::vector<double>& tops)
const;
304 std::vector<double> makeZcornDzTops(
const std::vector<double>& dz,
const std::vector<double>& tops)
const ;
305 std::vector<double> makeZcornDzvDepthz(
const std::vector<double>& dzv,
const std::vector<double>& depthz)
const;
306 std::vector<double> makeCoordDxvDyvDzvDepthz(
const std::vector<double>& dxv,
const std::vector<double>& dyv,
const std::vector<double>& dzv,
const std::vector<double>& depthz)
const;
308 void getCellCorners(
const std::array<int, 3>& ijk,
const std::array<int, 3>& dims, std::array<double,8>& X, std::array<double,8>& Y, std::array<double,8>& Z)
const;
309 void getCellCorners(
const std::size_t globalIndex,
310 std::array<double,8>& X,
311 std::array<double,8>& Y,
312 std::array<double,8>& Z)
const;