2014-03-31 14:19:34 +02:00
|
|
|
/*
|
|
|
|
|
Copyright 2014 Statoil ASA.
|
|
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef ECLIPSE_GRID_HPP_
|
|
|
|
|
#define ECLIPSE_GRID_HPP_
|
|
|
|
|
|
|
|
|
|
#include <opm/parser/eclipse/Deck/Section.hpp>
|
|
|
|
|
|
|
|
|
|
#include <ert/ecl/ecl_grid.h>
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
namespace Opm {
|
|
|
|
|
|
|
|
|
|
class EclipseGrid {
|
|
|
|
|
public:
|
|
|
|
|
EclipseGrid(std::shared_ptr<const RUNSPECSection> runspecSection, std::shared_ptr<const GRIDSection> gridSection);
|
|
|
|
|
|
|
|
|
|
static bool hasCornerPointKeywords(std::shared_ptr<const GRIDSection> gridSection);
|
|
|
|
|
static bool hasCartesianKeywords(std::shared_ptr<const GRIDSection> gridSection);
|
|
|
|
|
void initCartesianGrid(const std::vector<int>& dims , std::shared_ptr<const GRIDSection> gridSection);
|
2014-04-01 09:06:43 +02:00
|
|
|
void initCornerPointGrid(const std::vector<int>& dims , std::shared_ptr<const GRIDSection> gridSection);
|
|
|
|
|
int getNumActive( ) const;
|
2014-03-31 14:19:34 +02:00
|
|
|
int getNX( ) const;
|
|
|
|
|
int getNY( ) const;
|
|
|
|
|
int getNZ( ) const;
|
2014-05-16 13:14:16 +02:00
|
|
|
int getCartesianSize( ) const;
|
2014-04-22 00:20:03 +02:00
|
|
|
|
2014-04-22 01:14:34 +02:00
|
|
|
void exportMAPAXES( std::vector<double>& mapaxes) const;
|
2014-04-22 00:20:03 +02:00
|
|
|
void exportCOORD( std::vector<double>& coord) const;
|
|
|
|
|
void exportZCORN( std::vector<double>& zcorn) const;
|
|
|
|
|
void exportACTNUM( std::vector<int>& actnum) const;
|
2014-04-27 23:17:50 +02:00
|
|
|
bool equal(const EclipseGrid& other) const;
|
2014-03-31 14:19:34 +02:00
|
|
|
private:
|
|
|
|
|
std::shared_ptr<ecl_grid_type> m_grid;
|
|
|
|
|
|
2014-04-27 22:23:30 +02:00
|
|
|
void assertCornerPointKeywords( const std::vector<int>& dims , std::shared_ptr<const GRIDSection> gridSection ) const ;
|
2014-04-27 23:17:50 +02:00
|
|
|
void initDTOPSGrid(const std::vector<int>& dims , std::shared_ptr<const GRIDSection> gridSection);
|
|
|
|
|
void initDVDEPTHZGrid(const std::vector<int>& dims , std::shared_ptr<const GRIDSection> gridSection);
|
|
|
|
|
static bool hasDVDEPTHZKeywords(std::shared_ptr<const GRIDSection> gridSection);
|
|
|
|
|
static bool hasDTOPSKeywords(std::shared_ptr<const GRIDSection> gridSection);
|
|
|
|
|
static void assertVectorSize(const std::vector<double>& vector , size_t expectedSize , const std::string& msg);
|
2014-03-31 14:19:34 +02:00
|
|
|
std::vector<double> createTOPSVector(const std::vector<int>& dims , const std::vector<double>& DZ , std::shared_ptr<const GRIDSection> gridSection);
|
|
|
|
|
std::vector<double> createDVector(const std::vector<int>& dims , size_t dim , const std::string& DKey , const std::string& DVKey, std::shared_ptr<const GRIDSection> gridSection);
|
|
|
|
|
void scatterDim(const std::vector<int>& dims , size_t dim , const std::vector<double>& DV , std::vector<double>& D);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef std::shared_ptr<EclipseGrid> EclipseGridPtr;
|
|
|
|
|
typedef std::shared_ptr<const EclipseGrid> EclipseGridConstPtr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|