2017-08-31 13:49:09 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
|
|
|
|
#include <opm/parser/eclipse/EclipseState/Grid/FaultCollection.hpp>
|
|
|
|
|
#include <opm/parser/eclipse/EclipseState/Grid/FaultFace.hpp>
|
|
|
|
|
#include <opm/parser/eclipse/EclipseState/Grid/Fault.hpp>
|
|
|
|
|
#include <opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp>
|
|
|
|
|
|
2019-09-13 09:40:13 +02:00
|
|
|
#include "export.hpp"
|
2017-08-31 13:49:09 +02:00
|
|
|
|
|
|
|
|
|
2017-09-07 14:38:31 +02:00
|
|
|
namespace {
|
2017-08-31 13:49:09 +02:00
|
|
|
py::tuple getXYZ( const EclipseGrid& grid ) {
|
|
|
|
|
return py::make_tuple( grid.getNX(),
|
|
|
|
|
grid.getNY(),
|
|
|
|
|
grid.getNZ());
|
|
|
|
|
}
|
2018-01-30 07:46:03 +01:00
|
|
|
|
2017-08-31 13:49:09 +02:00
|
|
|
int getNumActive( const EclipseGrid& grid ) {
|
|
|
|
|
return grid.getNumActive();
|
|
|
|
|
}
|
2018-01-30 07:46:03 +01:00
|
|
|
|
2017-08-31 13:49:09 +02:00
|
|
|
int getCartesianSize( const EclipseGrid& grid ) {
|
|
|
|
|
return grid.getCartesianSize();
|
|
|
|
|
}
|
2018-01-30 07:46:03 +01:00
|
|
|
|
2017-08-31 13:49:09 +02:00
|
|
|
int getGlobalIndex( const EclipseGrid& grid, int i, int j, int k ) {
|
|
|
|
|
return grid.getGlobalIndex(i, j, k);
|
|
|
|
|
}
|
2018-01-30 07:46:03 +01:00
|
|
|
|
2017-08-31 13:49:09 +02:00
|
|
|
py::tuple getIJK( const EclipseGrid& grid, int g ) {
|
|
|
|
|
const auto& ijk = grid.getIJK(g);
|
|
|
|
|
return py::make_tuple(ijk[0], ijk[1], ijk[2]);
|
|
|
|
|
}
|
2018-01-30 07:46:03 +01:00
|
|
|
|
2017-08-31 13:49:09 +02:00
|
|
|
double cellVolume1G( const EclipseGrid& grid, size_t glob_idx) {
|
|
|
|
|
return grid.getCellVolume(glob_idx);
|
|
|
|
|
}
|
2018-01-30 07:46:03 +01:00
|
|
|
|
2017-08-31 13:49:09 +02:00
|
|
|
double cellVolume3( const EclipseGrid& grid, size_t i_idx, size_t j_idx, size_t k_idx) {
|
|
|
|
|
return grid.getCellVolume(i_idx, j_idx, k_idx);
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-07 14:38:31 +02:00
|
|
|
}
|
2017-08-31 13:49:09 +02:00
|
|
|
|
2019-09-13 09:22:49 +02:00
|
|
|
void python::common::export_EclipseGrid(py::module& module) {
|
2017-08-31 13:49:09 +02:00
|
|
|
|
2018-01-30 07:46:03 +01:00
|
|
|
py::class_< EclipseGrid >( module, "EclipseGrid")
|
2017-09-07 14:38:31 +02:00
|
|
|
.def( "_getXYZ", &getXYZ )
|
|
|
|
|
.def( "nactive", &getNumActive )
|
|
|
|
|
.def( "cartesianSize", &getCartesianSize )
|
|
|
|
|
.def( "globalIndex", &getGlobalIndex )
|
|
|
|
|
.def( "getIJK", &getIJK )
|
|
|
|
|
.def( "_cellVolume1G", &cellVolume1G)
|
|
|
|
|
.def( "_cellVolume3", &cellVolume3)
|
2018-01-30 07:46:03 +01:00
|
|
|
;
|
2017-08-31 13:49:09 +02:00
|
|
|
|
|
|
|
|
}
|