Rewritten EclipseGridParser to use input actnum instead of ACTNUM from deck

This commit is contained in:
Joakim Hove 2013-07-24 14:42:40 +02:00
parent efc44daf76
commit 8c32146093
2 changed files with 4 additions and 4 deletions

View File

@ -966,7 +966,7 @@ ecl_grid_type * EclipseGridParser::newGrid( ) {
} }
*/ */
void EclipseGridParser::saveEGRID( const std::string & filename) const { void EclipseGridParser::saveEGRID( const std::string & filename , std::vector<int>& actnum) const {
bool endian_flip = true;//ECL_ENDIAN_FLIP; bool endian_flip = true;//ECL_ENDIAN_FLIP;
bool fmt_file; bool fmt_file;
struct grdecl grdecl = get_grdecl(); struct grdecl grdecl = get_grdecl();
@ -994,7 +994,7 @@ void EclipseGridParser::saveEGRID( const std::string & filename) const {
{ {
ecl_kw_type * coord_kw = newEclKW( COORD_KW , ECL_FLOAT_TYPE ); ecl_kw_type * coord_kw = newEclKW( COORD_KW , ECL_FLOAT_TYPE );
ecl_kw_type * zcorn_kw = newEclKW( ZCORN_KW , ECL_FLOAT_TYPE ); ecl_kw_type * zcorn_kw = newEclKW( ZCORN_KW , ECL_FLOAT_TYPE );
ecl_kw_type * actnum_kw = newEclKW( ACTNUM_KW , ECL_INT_TYPE ); ecl_kw_type * actnum_kw = ecl_kw_alloc_new_shared( ACTNUM_KW , grdecl.dims[0] * grdecl.dims[1] * grdecl.dims[2] , ECL_INT_TYPE , &actnum );
ecl_kw_type * endgrid_kw = ecl_kw_alloc( ENDGRID_KW , 0 , ECL_INT_TYPE ); ecl_kw_type * endgrid_kw = ecl_kw_alloc( ENDGRID_KW , 0 , ECL_INT_TYPE );
ecl_kw_fwrite( coord_kw , fortio ); ecl_kw_fwrite( coord_kw , fortio );
@ -1092,7 +1092,7 @@ void EclipseGridParser::saveEGRID_INIT( const std::string& output_dir , const st
} }
#else #else
void EclipseGridParser::saveEGRID( const std::string & filename) const void EclipseGridParser::saveEGRID( const std::string & filename, std::vector<int>& actnum) const
{ {
static_cast<void>(filename); // Suppress "unused variable" warning. static_cast<void>(filename); // Suppress "unused variable" warning.
THROW("Cannot write EGRID format without ERT library support. Reconfigure opm-core with ERT support and recompile."); THROW("Cannot write EGRID format without ERT library support. Reconfigure opm-core with ERT support and recompile.");

View File

@ -226,7 +226,7 @@ public:
struct grdecl get_grdecl() const; struct grdecl get_grdecl() const;
/// Save grid parts of deck in EGRID format. /// Save grid parts of deck in EGRID format.
void saveEGRID(const std::string & filename) const; void saveEGRID(const std::string & filename, std::vector<int>& actnum) const;
#ifdef HAVE_ERT #ifdef HAVE_ERT
void saveEGRID_INIT( const std::string& output_dir , const std::string& basename, bool fmt_file = false); void saveEGRID_INIT( const std::string& output_dir , const std::string& basename, bool fmt_file = false);