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 hasCylindricalKeywords(
const Deck& deck);
84 static bool hasCornerPointKeywords(
const Deck&);
85 static bool hasCartesianKeywords(
const Deck&);
86 size_t getNumActive( )
const;
87 bool allActive()
const;
89 size_t activeIndex(
size_t i,
size_t j,
size_t k)
const;
90 size_t activeIndex(
size_t globalIndex)
const;
92 size_t getActiveIndex(
size_t i,
size_t j,
size_t k)
const {
93 return activeIndex(i, j, k);
96 void save(
const std::string& filename,
bool formatted,
const std::vector<Opm::NNCdata>& nnc,
const Opm::UnitSystem& units)
const;
103 size_t getGlobalIndex(
size_t active_index)
const;
104 size_t getGlobalIndex(
size_t i,
size_t j,
size_t k)
const;
114 bool isPinchActive()
const;
115 double getPinchThresholdThickness()
const;
116 PinchMode getPinchOption()
const;
117 PinchMode getMultzOption()
const;
118 PinchMode getPinchGapMode()
const;
119 double getPinchMaxEmptyGap()
const;
121 MinpvMode getMinpvMode()
const;
122 const std::vector<double>& getMinpvVector( )
const;
138 std::vector<T> compressedVector(
const std::vector<T>& input_vector)
const {
139 if( input_vector.size() == this->getNumActive() ) {
143 if (input_vector.size() != getCartesianSize())
144 throw std::invalid_argument(
"Input vector must have full size");
147 std::vector<T> compressed_vector( this->getNumActive() );
150 for (
size_t i = 0; i < this->getNumActive(); ++i)
151 compressed_vector[i] = input_vector[ active_map[i] ];
153 return compressed_vector;
161 std::array<double, 3> getCellCenter(
size_t i,
size_t j,
size_t k)
const;
162 std::array<double, 3> getCellCenter(
size_t globalIndex)
const;
163 std::array<double, 3> getCornerPos(
size_t i,
size_t j,
size_t k,
size_t corner_index)
const;
164 const std::vector<double>& activeVolume()
const;
165 double getCellVolume(
size_t globalIndex)
const;
166 double getCellVolume(
size_t i ,
size_t j ,
size_t k)
const;
167 double getCellThickness(
size_t globalIndex)
const;
168 double getCellThickness(
size_t i ,
size_t j ,
size_t k)
const;
169 std::array<double, 3> getCellDims(
size_t i,
size_t j,
size_t k)
const;
170 std::array<double, 3> getCellDims(
size_t globalIndex)
const;
171 bool cellActive(
size_t globalIndex )
const;
172 bool cellActive(
size_t i ,
size_t j,
size_t k )
const;
174 std::array<double, 3> getCellDimensions(
size_t i,
size_t j,
size_t k)
const {
175 return getCellDims(i, j, k);
178 bool isCellActive(
size_t i,
size_t j,
size_t k)
const {
179 return cellActive(i, j, k);
190 double getCellDepth(
size_t i,
size_t j,
size_t k)
const;
191 double getCellDepth(
size_t globalIndex)
const;
194 const std::vector<double>& getCOORD()
const;
195 const std::vector<double>& getZCORN()
const;
196 const std::vector<int>& getACTNUM( )
const;
206 size_t getZcornFixed() {
return zcorn_fixed; };
211 void resetACTNUM(
const std::vector<int>& actnum);
214 static bool hasDVDEPTHZKeywords(
const Deck&);
223 static bool hasEqualDVDEPTHZ(
const Deck&);
224 static bool allEqual(
const std::vector<double> &v);
227 std::vector<double> m_minpvVector;
228 MinpvMode m_minpvMode;
229 std::optional<double> m_pinch;
230 PinchMode m_pinchoutMode;
231 PinchMode m_multzMode;
232 PinchMode m_pinchGapMode;
233 double m_pinchMaxEmptyGap;
235 mutable std::optional<std::vector<double>> active_volume;
237 bool m_circle =
false;
239 size_t zcorn_fixed = 0;
240 bool m_useActnumFromGdfile =
false;
243 mutable std::optional<std::vector<double>> m_input_zcorn;
244 mutable std::optional<std::vector<double>> m_input_coord;
246 std::vector<double> m_zcorn;
247 std::vector<double> m_coord;
250 std::vector<int> m_actnum;
251 std::optional<MapAxes> m_mapaxes;
255 std::vector<int> m_active_to_global;
256 std::vector<int> m_global_to_active;
258 std::unordered_set<size_t> m_aquifer_cells;
260 std::map<size_t, double> m_aquifer_cell_depths;
263 std::optional<std::vector<double>> m_thetav;
264 std::optional<std::vector<double>> m_rv;
266 void updateNumericalAquiferCells(
const Deck&);
267 double computeCellGeometricDepth(
size_t globalIndex)
const;
270 void resetACTNUM(
const int* actnum);
272 void initBinaryGrid(
const Deck& deck);
274 void initCornerPointGrid(
const std::vector<double>& coord ,
275 const std::vector<double>& zcorn ,
278 bool keywInputBeforeGdfile(
const Deck& deck,
const std::string& keyword)
const;
280 void initCylindricalGrid(
const Deck&);
281 void initSpiderwebGrid(
const Deck&);
282 void initSpiderwebOrCylindricalGrid(
const Deck&,
const bool);
283 void initCartesianGrid(
const Deck&);
284 void initDTOPSGrid(
const Deck&);
285 void initDVDEPTHZGrid(
const Deck&);
286 void initGrid(
const Deck&,
const int* actnum);
287 void initCornerPointGrid(
const Deck&);
288 void assertCornerPointKeywords(
const Deck&);
290 static bool hasDTOPSKeywords(
const Deck&);
291 static void assertVectorSize(
const std::vector<double>& vector,
size_t expectedSize,
const std::string& msg);
293 static std::vector<double> createTOPSVector(
const std::array<int, 3>& dims,
const std::vector<double>& DZ,
const Deck&);
294 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&);
295 static void scatterDim(
const std::array<int, 3>& dims ,
size_t dim ,
const std::vector<double>& DV , std::vector<double>& D);
298 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;
299 std::vector<double> makeZcornDzTops(
const std::vector<double>& dz,
const std::vector<double>& tops)
const ;
300 std::vector<double> makeZcornDzvDepthz(
const std::vector<double>& dzv,
const std::vector<double>& depthz)
const;
301 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;
303 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;
304 void getCellCorners(
const std::size_t globalIndex,
305 std::array<double,8>& X,
306 std::array<double,8>& Y,
307 std::array<double,8>& Z)
const;