ERT: Use 1-based ids for well branches and segments. Removed adding of 1

in picking text info in RimReservoirView.

Integraded ERT from
0f9e820554
This commit is contained in:
Magne Sjaastad 2013-10-08 12:31:15 +02:00
parent bbb33064b0
commit d1f8f383c4
16 changed files with 92 additions and 64 deletions

View File

@ -1090,7 +1090,7 @@ void RimReservoirView::appendCellResultInfo(size_t gridIndex, size_t cellIndex,
const RigWellResultPoint* wellResultCell = wellResultFrame.findResultCell(gridIndex, cellIndex); const RigWellResultPoint* wellResultCell = wellResultFrame.findResultCell(gridIndex, cellIndex);
if (wellResultCell) if (wellResultCell)
{ {
resultInfoText->append(QString("Well-cell connection info: Well Name: %1 Branch Id: %2 Segment Id: %3\n").arg(singleWellResultData->m_wellName).arg(wellResultCell->m_ertBranchId +1).arg(wellResultCell->m_ertSegmentId+1)); resultInfoText->append(QString("Well-cell connection info: Well Name: %1 Branch Id: %2 Segment Id: %3\n").arg(singleWellResultData->m_wellName).arg(wellResultCell->m_ertBranchId).arg(wellResultCell->m_ertSegmentId));
} }
} }
} }

View File

@ -61,7 +61,7 @@ extern "C" {
int well_conn_get_k(const well_conn_type * conn); int well_conn_get_k(const well_conn_type * conn);
well_conn_dir_enum well_conn_get_dir(const well_conn_type * conn); well_conn_dir_enum well_conn_get_dir(const well_conn_type * conn);
bool well_conn_open( const well_conn_type * conn ); bool well_conn_open( const well_conn_type * conn );
int well_conn_get_segment( const well_conn_type * conn ); int well_conn_get_segment_id( const well_conn_type * conn );
bool well_conn_fracture_connection( const well_conn_type * conn); bool well_conn_fracture_connection( const well_conn_type * conn);
bool well_conn_matrix_connection( const well_conn_type * conn); bool well_conn_matrix_connection( const well_conn_type * conn);
bool well_conn_equal( const well_conn_type *conn1 , const well_conn_type * conn2); bool well_conn_equal( const well_conn_type *conn1 , const well_conn_type * conn2);

View File

@ -24,6 +24,25 @@
extern "C" { extern "C" {
#endif #endif
#define WELL_SEGMENT_OFFSET 1
#define WELL_BRANCH_OFFSET 1
#define ECLIPSE_WELL_SEGMENT_OFFSET 1
#define ECLIPSE_WELL_BRANCH_OFFSET 1
/* These values are taken from the ISEG description in table 6.1 in ECLIPSE file formats reference. */
#define ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE 0
#define ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE 1
#define ECLIPSE_WELL_SEGMENT_INACTIVE_VALUE 0
#define ECLIPSE_CONN_NORMAL_WELL_SEGMENT_VALUE 0
#define WELL_SEGMENT_OUTLET_END_VALUE (WELL_SEGMENT_OFFSET + ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE - ECLIPSE_WELL_SEGMENT_OFFSET) // -1
#define WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE (WELL_BRANCH_OFFSET + ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE - ECLIPSE_WELL_BRANCH_OFFSET) // 0
#define WELL_SEGMENT_BRANCH_INACTIVE_VALUE (WELL_BRANCH_OFFSET + ECLIPSE_WELL_SEGMENT_INACTIVE_VALUE - ECLIPSE_WELL_BRANCH_OFFSET) // -1
#define CONN_NORMAL_WELL_SEGMENT_VALUE (WELL_SEGMENT_OFFSET + ECLIPSE_CONN_NORMAL_WELL_SEGMENT_VALUE - ECLIPSE_WELL_SEGMENT_OFFSET)
/* /*
Observe that the values given as _ITEM are not indices which can Observe that the values given as _ITEM are not indices which can
be directly used in the IWEL or ICON keywords; an offset must be be directly used in the IWEL or ICON keywords; an offset must be

View File

@ -33,17 +33,12 @@ extern "C" {
#include <ert/ecl_well/well_conn_collection.h> #include <ert/ecl_well/well_conn_collection.h>
#include <ert/ecl_well/well_conn.h> #include <ert/ecl_well/well_conn.h>
/* The values are shifted one down compared to ISEG description in table 6.1 in ECLIPSE file formats reference. */
#define ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE -1
#define ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE 0
#define ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE -1
typedef struct well_segment_struct well_segment_type; typedef struct well_segment_struct well_segment_type;
well_segment_type * well_segment_alloc_from_kw( const ecl_kw_type * iseg_kw , const ecl_kw_type * rseg_kw , const ecl_rsthead_type * header , int well_nr, int segment_id); well_segment_type * well_segment_alloc_from_kw( const ecl_kw_type * iseg_kw , const ecl_kw_type * rseg_kw , const ecl_rsthead_type * header , int well_nr, int segment_index , int segment_id);
well_segment_type * well_segment_alloc(int segment_id , int outlet_segment_id , int branch_id , const double * rseg_data); well_segment_type * well_segment_alloc(int segment_id , int outlet_segment_id , int branch_id , const double * rseg_data);
void well_segment_free(well_segment_type * segment ); void well_segment_free(well_segment_type * segment );
void well_segment_free__(void * arg); void well_segment_free__(void * arg);

View File

@ -115,3 +115,6 @@ bool well_branch_collection_add_start_segment( well_branch_collection_type * bra
return false; return false;
} }

View File

@ -30,7 +30,7 @@
#define WELL_CONN_NORMAL_WELL_SEGMENT_ID -999 #define WELL_CONN_NORMAL_WELL_SEGMENT_ID -999
#define ECLIPSE_NORMAL_WELL_SEGMENT_ID -1 //#define ECLIPSE_NORMAL_WELL_SEGMENT_ID -1
/* /*
Observe that when the (ijk) values are initialized they are Observe that when the (ijk) values are initialized they are
@ -47,7 +47,7 @@ struct well_conn_struct {
int k; int k;
well_conn_dir_enum dir; well_conn_dir_enum dir;
bool open; bool open;
int segment; // -1: Ordinary well int segment_id; // -1: Ordinary well
bool matrix_connection; // k >= nz => fracture (and k -= nz ) bool matrix_connection; // k >= nz => fracture (and k -= nz )
}; };
@ -62,7 +62,7 @@ bool well_conn_equal( const well_conn_type *conn1 , const well_conn_type * conn
bool well_conn_MSW( const well_conn_type * conn ) { bool well_conn_MSW( const well_conn_type * conn ) {
if (conn->segment == WELL_CONN_NORMAL_WELL_SEGMENT_ID) if (conn->segment_id == WELL_CONN_NORMAL_WELL_SEGMENT_ID)
return false; return false;
else else
return true; return true;
@ -91,10 +91,10 @@ static well_conn_type * well_conn_alloc__( int i , int j , int k , well_conn_dir
conn->dir = dir; conn->dir = dir;
conn->matrix_connection = matrix_connection; conn->matrix_connection = matrix_connection;
if (segment_id == ECLIPSE_NORMAL_WELL_SEGMENT_ID) if (segment_id == CONN_NORMAL_WELL_SEGMENT_VALUE)
conn->segment = WELL_CONN_NORMAL_WELL_SEGMENT_ID; conn->segment_id = WELL_CONN_NORMAL_WELL_SEGMENT_ID;
else else
conn->segment = segment_id; conn->segment_id = segment_id;
return conn; return conn;
} else { } else {
@ -110,8 +110,8 @@ well_conn_type * well_conn_alloc( int i , int j , int k , well_conn_dir_enum dir
well_conn_type * well_conn_alloc_MSW( int i , int j , int k , well_conn_dir_enum dir , bool open, int segment) { well_conn_type * well_conn_alloc_MSW( int i , int j , int k , well_conn_dir_enum dir , bool open, int segment_id) {
return well_conn_alloc__(i , j , k , dir , open , segment , true ); return well_conn_alloc__(i , j , k , dir , open , segment_id , true );
} }
@ -122,8 +122,8 @@ well_conn_type * well_conn_alloc_fracture( int i , int j , int k , well_conn_dir
well_conn_type * well_conn_alloc_fracture_MSW( int i , int j , int k , well_conn_dir_enum dir , bool open, int segment) { well_conn_type * well_conn_alloc_fracture_MSW( int i , int j , int k , well_conn_dir_enum dir , bool open, int segment_id) {
return well_conn_alloc__(i , j , k , dir , open , segment , false); return well_conn_alloc__(i , j , k , dir , open , segment_id , false);
} }
@ -145,7 +145,7 @@ well_conn_type * well_conn_alloc_from_kw( const ecl_kw_type * icon_kw ,
int i = ecl_kw_iget_int( icon_kw , icon_offset + ICON_I_ITEM ) - 1; int i = ecl_kw_iget_int( icon_kw , icon_offset + ICON_I_ITEM ) - 1;
int j = ecl_kw_iget_int( icon_kw , icon_offset + ICON_J_ITEM ) - 1; int j = ecl_kw_iget_int( icon_kw , icon_offset + ICON_J_ITEM ) - 1;
int k = ecl_kw_iget_int( icon_kw , icon_offset + ICON_K_ITEM ) - 1; int k = ecl_kw_iget_int( icon_kw , icon_offset + ICON_K_ITEM ) - 1;
int segment = ecl_kw_iget_int( icon_kw , icon_offset + ICON_SEGMENT_ITEM ) - 1; int segment_id = ecl_kw_iget_int( icon_kw , icon_offset + ICON_SEGMENT_ITEM ) - ECLIPSE_WELL_SEGMENT_OFFSET + WELL_SEGMENT_OFFSET;
bool matrix_connection = true; bool matrix_connection = true;
bool open; bool open;
well_conn_dir_enum dir = well_conn_fracX; well_conn_dir_enum dir = well_conn_fracX;
@ -199,7 +199,7 @@ well_conn_type * well_conn_alloc_from_kw( const ecl_kw_type * icon_kw ,
} }
} }
conn = well_conn_alloc__(i,j,k,dir,open,segment,matrix_connection); conn = well_conn_alloc__(i,j,k,dir,open,segment_id,matrix_connection);
/** /**
For multisegmented wells ONLY the global part of the restart For multisegmented wells ONLY the global part of the restart
@ -298,8 +298,8 @@ bool well_conn_open( const well_conn_type * conn ) {
} }
int well_conn_get_segment( const well_conn_type * conn ) { int well_conn_get_segment_id( const well_conn_type * conn ) {
return conn->segment; return conn->segment_id;
} }
bool well_conn_fracture_connection( const well_conn_type * conn) { bool well_conn_fracture_connection( const well_conn_type * conn) {

View File

@ -72,15 +72,15 @@ well_segment_type * well_segment_alloc(int segment_id , int outlet_segment_id ,
} }
well_segment_type * well_segment_alloc_from_kw( const ecl_kw_type * iseg_kw , const ecl_kw_type * rseg_kw , const ecl_rsthead_type * header , int well_nr, int segment_id) { well_segment_type * well_segment_alloc_from_kw( const ecl_kw_type * iseg_kw , const ecl_kw_type * rseg_kw , const ecl_rsthead_type * header , int well_nr, int segment_index , int segment_id) {
if (rseg_kw == NULL) { if (rseg_kw == NULL) {
util_abort("%s: fatal internal error - tried to create well_segment instance without RSEG keyword.\n",__func__); util_abort("%s: fatal internal error - tried to create well_segment instance without RSEG keyword.\n",__func__);
return NULL; return NULL;
} else { } else {
const int iseg_offset = header->nisegz * ( header->nsegmx * well_nr + segment_id); const int iseg_offset = header->nisegz * ( header->nsegmx * well_nr + segment_index);
const int rseg_offset = header->nrsegz * ( header->nsegmx * well_nr + segment_id); const int rseg_offset = header->nrsegz * ( header->nsegmx * well_nr + segment_index);
int outlet_segment_id = ecl_kw_iget_int( iseg_kw , iseg_offset + ISEG_OUTLET_ITEM ) - 1; int outlet_segment_id = ecl_kw_iget_int( iseg_kw , iseg_offset + ISEG_OUTLET_ITEM ) - ECLIPSE_WELL_SEGMENT_OFFSET + WELL_SEGMENT_OFFSET ; // -1
int branch_id = ecl_kw_iget_int( iseg_kw , iseg_offset + ISEG_BRANCH_ITEM ) - 1; int branch_id = ecl_kw_iget_int( iseg_kw , iseg_offset + ISEG_BRANCH_ITEM ) - ECLIPSE_WELL_BRANCH_OFFSET + WELL_BRANCH_OFFSET ; // -1
const double * rseg_data = ecl_kw_iget_ptr( rseg_kw , rseg_offset ); const double * rseg_data = ecl_kw_iget_ptr( rseg_kw , rseg_offset );
well_segment_type * segment = well_segment_alloc( segment_id , outlet_segment_id , branch_id , rseg_data); well_segment_type * segment = well_segment_alloc( segment_id , outlet_segment_id , branch_id , rseg_data);
@ -116,7 +116,7 @@ void well_segment_free__(void * arg) {
bool well_segment_active( const well_segment_type * segment ) { bool well_segment_active( const well_segment_type * segment ) {
if (segment->branch_id == ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE) if (segment->branch_id == WELL_SEGMENT_BRANCH_INACTIVE_VALUE)
return false; return false;
else else
return true; return true;
@ -124,7 +124,7 @@ bool well_segment_active( const well_segment_type * segment ) {
bool well_segment_main_stem( const well_segment_type * segment ) { bool well_segment_main_stem( const well_segment_type * segment ) {
if (segment->branch_id == ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE) if (segment->branch_id == WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE)
return true; return true;
else else
return false; return false;
@ -132,7 +132,7 @@ bool well_segment_main_stem( const well_segment_type * segment ) {
bool well_segment_nearest_wellhead( const well_segment_type * segment ) { bool well_segment_nearest_wellhead( const well_segment_type * segment ) {
if (segment->outlet_segment_id == ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE) if (segment->outlet_segment_id == WELL_SEGMENT_OUTLET_END_VALUE)
return true; return true;
else else
return false; return false;
@ -195,7 +195,7 @@ bool well_segment_has_global_grid_connections( const well_segment_type * segment
bool well_segment_add_connection( well_segment_type * segment , const char * grid_name , well_conn_type * conn) { bool well_segment_add_connection( well_segment_type * segment , const char * grid_name , well_conn_type * conn) {
int conn_segment_id = well_conn_get_segment( conn ); int conn_segment_id = well_conn_get_segment_id( conn );
if (conn_segment_id == segment->segment_id) { if (conn_segment_id == segment->segment_id) {
if (!well_segment_has_grid_connections( segment , grid_name )) if (!well_segment_has_grid_connections( segment , grid_name ))
hash_insert_hash_owned_ref( segment->connections , grid_name , well_conn_collection_alloc() , well_conn_collection_free__ ); hash_insert_hash_owned_ref( segment->connections , grid_name , well_conn_collection_alloc() , well_conn_collection_free__ );

View File

@ -111,9 +111,10 @@ int well_segment_collection_load_from_kw( well_segment_collection_type * segment
int segments_added = 0; int segments_added = 0;
if (segment_well_nr != IWEL_SEGMENTED_WELL_NR_NORMAL_VALUE) { if (segment_well_nr != IWEL_SEGMENTED_WELL_NR_NORMAL_VALUE) {
int segment_id; int segment_index;
for (segment_id = 0; segment_id < rst_head->nsegmx; segment_id++) { for (segment_index = 0; segment_index < rst_head->nsegmx; segment_index++) {
well_segment_type * segment = well_segment_alloc_from_kw( iseg_kw , rseg_kw , rst_head , segment_well_nr , segment_id ); int segment_id = segment_index + WELL_SEGMENT_OFFSET;
well_segment_type * segment = well_segment_alloc_from_kw( iseg_kw , rseg_kw , rst_head , segment_well_nr , segment_index , segment_id );
if (well_segment_active( segment )) { if (well_segment_active( segment )) {
well_segment_collection_add( segment_collection , segment ); well_segment_collection_add( segment_collection , segment );
@ -122,7 +123,6 @@ int well_segment_collection_load_from_kw( well_segment_collection_type * segment
well_segment_free( segment ); well_segment_free( segment );
} }
} }
return segments_added; return segments_added;
} }
@ -148,7 +148,7 @@ void well_segment_collection_add_connections(well_segment_collection_type * segm
for (iconn = 0; iconn < well_conn_collection_get_size( connections ); iconn++) { for (iconn = 0; iconn < well_conn_collection_get_size( connections ); iconn++) {
well_conn_type * conn = well_conn_collection_iget( connections , iconn ); well_conn_type * conn = well_conn_collection_iget( connections , iconn );
if (well_conn_MSW( conn )) { if (well_conn_MSW( conn )) {
int segment_id = well_conn_get_segment( conn ); int segment_id = well_conn_get_segment_id( conn );
well_segment_type * segment = well_segment_collection_get( segment_collection , segment_id ); well_segment_type * segment = well_segment_collection_get( segment_collection , segment_id );
well_segment_add_connection( segment , grid_name , conn ); well_segment_add_connection( segment , grid_name , conn );
} }
@ -167,3 +167,6 @@ void well_segment_collection_add_branches( const well_segment_collection_type *
} }
} }

View File

@ -92,7 +92,7 @@ int main(int argc , char ** argv) {
test_assert_int_equal( i , well_conn_get_i( conn )); test_assert_int_equal( i , well_conn_get_i( conn ));
test_assert_int_equal( j , well_conn_get_j( conn )); test_assert_int_equal( j , well_conn_get_j( conn ));
test_assert_int_equal( k , well_conn_get_k( conn )); test_assert_int_equal( k , well_conn_get_k( conn ));
test_assert_int_equal( segment , well_conn_get_segment( conn )); test_assert_int_equal( segment , well_conn_get_segment_id( conn ));
test_assert_bool_equal( open , well_conn_open( conn )); test_assert_bool_equal( open , well_conn_open( conn ));
test_assert_int_equal( dir , well_conn_get_dir( conn )); test_assert_int_equal( dir , well_conn_get_dir( conn ));
test_assert_true( well_conn_MSW( conn )); test_assert_true( well_conn_MSW( conn ));
@ -109,7 +109,7 @@ int main(int argc , char ** argv) {
test_assert_int_equal( i , well_conn_get_i( conn )); test_assert_int_equal( i , well_conn_get_i( conn ));
test_assert_int_equal( j , well_conn_get_j( conn )); test_assert_int_equal( j , well_conn_get_j( conn ));
test_assert_int_equal( k , well_conn_get_k( conn )); test_assert_int_equal( k , well_conn_get_k( conn ));
test_assert_int_equal( segment , well_conn_get_segment( conn )); test_assert_int_equal( segment , well_conn_get_segment_id( conn ));
test_assert_bool_equal( open , well_conn_open( conn )); test_assert_bool_equal( open , well_conn_open( conn ));
test_assert_int_equal( dir , well_conn_get_dir( conn )); test_assert_int_equal( dir , well_conn_get_dir( conn ));
test_assert_true( well_conn_MSW( conn )); test_assert_true( well_conn_MSW( conn ));

View File

@ -43,7 +43,7 @@ int main(int argc , char ** argv) {
{ {
int segment_id = 78; int segment_id = 78;
int outlet_segment_id = 100; int outlet_segment_id = 100;
int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE; int branch_nr = WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE;
well_segment_type * ws = well_segment_alloc(segment_id , outlet_segment_id , branch_nr, rseg_data); well_segment_type * ws = well_segment_alloc(segment_id , outlet_segment_id , branch_nr, rseg_data);
test_assert_true( well_segment_is_instance( ws )); test_assert_true( well_segment_is_instance( ws ));
@ -66,7 +66,7 @@ int main(int argc , char ** argv) {
} }
{ {
int outlet_segment_id = ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE; int outlet_segment_id = WELL_SEGMENT_OUTLET_END_VALUE;
int branch_nr = 100; int branch_nr = 100;
well_segment_type * ws = well_segment_alloc(12 , outlet_segment_id , branch_nr, rseg_data); well_segment_type * ws = well_segment_alloc(12 , outlet_segment_id , branch_nr, rseg_data);
@ -76,17 +76,17 @@ int main(int argc , char ** argv) {
{ {
int outlet_segment_id = ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE; int outlet_segment_id = WELL_SEGMENT_OUTLET_END_VALUE;
int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE; int branch_nr = WELL_SEGMENT_BRANCH_INACTIVE_VALUE;
well_segment_type * ws = well_segment_alloc(89 , outlet_segment_id , branch_nr, rseg_data); well_segment_type * ws = well_segment_alloc(89 , outlet_segment_id , branch_nr, rseg_data);
test_assert_false( well_segment_active( ws )); test_assert_false( well_segment_active( ws ));
} }
{ {
int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE; int branch_nr = WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE;
int outlet_id = 0; int outlet_id = 0;
well_segment_type * outlet = well_segment_alloc(outlet_id , ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE , branch_nr, rseg_data); well_segment_type * outlet = well_segment_alloc(outlet_id , WELL_SEGMENT_OUTLET_END_VALUE , branch_nr, rseg_data);
well_segment_type * ws = well_segment_alloc(100 , outlet_id , branch_nr, rseg_data); well_segment_type * ws = well_segment_alloc(100 , outlet_id , branch_nr, rseg_data);
test_assert_true( well_segment_link( ws , outlet )); test_assert_true( well_segment_link( ws , outlet ));
@ -99,9 +99,9 @@ int main(int argc , char ** argv) {
} }
{ {
int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE; int branch_nr = WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE;
int outlet_id = 0; int outlet_id = 0;
well_segment_type * outlet = well_segment_alloc(outlet_id , ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE , branch_nr , rseg_data); well_segment_type * outlet = well_segment_alloc(outlet_id , WELL_SEGMENT_OUTLET_END_VALUE , branch_nr , rseg_data);
well_segment_type * ws = well_segment_alloc(100 , outlet_id + 1, branch_nr, rseg_data); well_segment_type * ws = well_segment_alloc(100 , outlet_id + 1, branch_nr, rseg_data);
test_assert_false( well_segment_link( ws , outlet )); test_assert_false( well_segment_link( ws , outlet ));

View File

@ -24,7 +24,7 @@
#include <ert/ecl/ecl_util.h> #include <ert/ecl/ecl_util.h>
#include <ert/ecl_well/well_const.h>
#include <ert/ecl_well/well_segment_collection.h> #include <ert/ecl_well/well_segment_collection.h>
@ -37,8 +37,8 @@ int main(int argc , char ** argv) {
test_assert_int_equal( well_segment_collection_get_size( sc ) , 0 ); test_assert_int_equal( well_segment_collection_get_size( sc ) , 0 );
{ {
int outlet_segment_id = ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE; int outlet_segment_id = WELL_SEGMENT_OUTLET_END_VALUE;
int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE; int branch_nr = WELL_SEGMENT_BRANCH_INACTIVE_VALUE;
well_segment_type * ws = well_segment_alloc(89 , outlet_segment_id , branch_nr, rseg_data); well_segment_type * ws = well_segment_alloc(89 , outlet_segment_id , branch_nr, rseg_data);
well_segment_collection_add( sc , ws ); well_segment_collection_add( sc , ws );
@ -51,8 +51,8 @@ int main(int argc , char ** argv) {
} }
{ {
int outlet_segment_id = ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE; int outlet_segment_id = WELL_SEGMENT_OUTLET_END_VALUE;
int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE; int branch_nr = WELL_SEGMENT_BRANCH_INACTIVE_VALUE;
well_segment_type * ws = well_segment_alloc(90 , outlet_segment_id , branch_nr , rseg_data); well_segment_type * ws = well_segment_alloc(90 , outlet_segment_id , branch_nr , rseg_data);
well_segment_collection_add( sc , ws ); well_segment_collection_add( sc , ws );
@ -67,8 +67,8 @@ int main(int argc , char ** argv) {
} }
{ {
int outlet_segment_id = ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE; int outlet_segment_id = WELL_SEGMENT_OUTLET_END_VALUE;
int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE; int branch_nr = WELL_SEGMENT_BRANCH_INACTIVE_VALUE;
well_segment_type * ws = well_segment_alloc(89 , outlet_segment_id , branch_nr, rseg_data); well_segment_type * ws = well_segment_alloc(89 , outlet_segment_id , branch_nr, rseg_data);
well_segment_collection_add( sc , ws ); well_segment_collection_add( sc , ws );

View File

@ -25,6 +25,7 @@
#include <ert/ecl/ecl_util.h> #include <ert/ecl/ecl_util.h>
#include <ert/ecl/ecl_grid.h> #include <ert/ecl/ecl_grid.h>
#include <ert/ecl_well/well_const.h>
#include <ert/ecl_well/well_segment.h> #include <ert/ecl_well/well_segment.h>
#include <ert/ecl_well/well_conn.h> #include <ert/ecl_well/well_conn.h>
#include <ert/ecl_well/well_conn_collection.h> #include <ert/ecl_well/well_conn_collection.h>
@ -36,7 +37,7 @@ int main(int argc , char ** argv) {
{ {
int segment_id = 78; int segment_id = 78;
int outlet_segment_id = 100; int outlet_segment_id = 100;
int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE; int branch_nr = WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE;
well_segment_type * ws = well_segment_alloc(segment_id , outlet_segment_id , branch_nr, rseg_data); well_segment_type * ws = well_segment_alloc(segment_id , outlet_segment_id , branch_nr, rseg_data);
well_conn_type * conn1 = well_conn_alloc_MSW(1,1,1,true,well_conn_dirX,segment_id); well_conn_type * conn1 = well_conn_alloc_MSW(1,1,1,true,well_conn_dirX,segment_id);
well_conn_type * conn2 = well_conn_alloc_MSW(1,1,1,true,well_conn_dirX,segment_id + 1); well_conn_type * conn2 = well_conn_alloc_MSW(1,1,1,true,well_conn_dirX,segment_id + 1);

View File

@ -52,11 +52,12 @@ int main(int argc , char ** argv) {
well_segment_collection_type * segments = well_segment_collection_alloc(); well_segment_collection_type * segments = well_segment_collection_alloc();
int seg_well_nr = ecl_kw_iget_int( iwel_kw , iwel_offset + IWEL_SEGMENTED_WELL_NR_ITEM) - 1; // -1: Ordinary well. int seg_well_nr = ecl_kw_iget_int( iwel_kw , iwel_offset + IWEL_SEGMENTED_WELL_NR_ITEM) - 1; // -1: Ordinary well.
if (seg_well_nr >= 0) { if (seg_well_nr >= 0) {
int segment_id; int segment_index;
int segment_count = 0; int segment_count = 0;
for (segment_id = 0; segment_id < rst_head->nsegmx; segment_id++) { for (segment_index = 0; segment_index < rst_head->nsegmx; segment_index++) {
well_segment_type * segment = well_segment_alloc_from_kw( iseg_kw , rseg_kw , rst_head , seg_well_nr , segment_id ); int segment_id = segment_index + WELL_SEGMENT_OFFSET;
well_segment_type * segment = well_segment_alloc_from_kw( iseg_kw , rseg_kw , rst_head , seg_well_nr , segment_index , segment_id );
test_assert_true( well_segment_is_instance( segment )); test_assert_true( well_segment_is_instance( segment ));

View File

@ -1,6 +1,6 @@
include(cmake/find_python_module.cmake) include(cmake/find_python_module.cmake)
if (ERT_BUILD_GUI) if (ERT_BUILD_GUI)
FIND_PACKAGE(PythonInterp 2.7 REQUIRED) FIND_PACKAGE(PythonInterp 2.6 REQUIRED)
find_python_module(PyQt4 REQUIRED) find_python_module(PyQt4 REQUIRED)
else() else()
FIND_PACKAGE(PythonInterp 2.6 REQUIRED) FIND_PACKAGE(PythonInterp 2.6 REQUIRED)

View File

@ -1,6 +1,12 @@
import sys import sys
import warnings
REQUIRED_VERSION_HEX = 0x02070000 ABSOLUTE_REQUIRED_VERSION_HEX = 0x02060000
WARNING_REQUIRED_VERSION_HEX = 0x02070000
if sys.hexversion < REQUIRED_VERSION_HEX:
raise Exception("ERT GUI Python requires at least version 2.7 of Python") if sys.hexversion < ABSOLUTE_REQUIRED_VERSION_HEX:
raise Exception("ERT GUI Python requires at least version 2.6 of Python")
if sys.hexversion < WARNING_REQUIRED_VERSION_HEX:
warnings.warn("To get optimal graphical performance you should use Python 2.7")