mirror of
https://github.com/OPM/ResInsight.git
synced 2024-12-29 10:21:54 -06:00
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:
parent
bbb33064b0
commit
d1f8f383c4
@ -1090,7 +1090,7 @@ void RimReservoirView::appendCellResultInfo(size_t gridIndex, size_t cellIndex,
|
||||
const RigWellResultPoint* wellResultCell = wellResultFrame.findResultCell(gridIndex, cellIndex);
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ extern "C" {
|
||||
int well_conn_get_k(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 );
|
||||
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_matrix_connection( const well_conn_type * conn);
|
||||
bool well_conn_equal( const well_conn_type *conn1 , const well_conn_type * conn2);
|
||||
|
@ -24,6 +24,25 @@
|
||||
extern "C" {
|
||||
#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
|
||||
be directly used in the IWEL or ICON keywords; an offset must be
|
||||
|
@ -33,17 +33,12 @@ extern "C" {
|
||||
#include <ert/ecl_well/well_conn_collection.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;
|
||||
|
||||
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);
|
||||
void well_segment_free(well_segment_type * segment );
|
||||
void well_segment_free__(void * arg);
|
||||
|
@ -53,7 +53,7 @@ extern "C" {
|
||||
const well_conn_collection_type * connections);
|
||||
void well_segment_collection_add_branches( const well_segment_collection_type * segment_collection ,
|
||||
well_branch_collection_type * branches );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -114,4 +114,7 @@ bool well_branch_collection_add_start_segment( well_branch_collection_type * bra
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
28
ThirdParty/Ert/devel/libecl_well/src/well_conn.c
vendored
28
ThirdParty/Ert/devel/libecl_well/src/well_conn.c
vendored
@ -30,7 +30,7 @@
|
||||
|
||||
|
||||
#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
|
||||
@ -47,7 +47,7 @@ struct well_conn_struct {
|
||||
int k;
|
||||
well_conn_dir_enum dir;
|
||||
bool open;
|
||||
int segment; // -1: Ordinary well
|
||||
int segment_id; // -1: Ordinary well
|
||||
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 ) {
|
||||
if (conn->segment == WELL_CONN_NORMAL_WELL_SEGMENT_ID)
|
||||
if (conn->segment_id == WELL_CONN_NORMAL_WELL_SEGMENT_ID)
|
||||
return false;
|
||||
else
|
||||
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->matrix_connection = matrix_connection;
|
||||
if (segment_id == ECLIPSE_NORMAL_WELL_SEGMENT_ID)
|
||||
conn->segment = WELL_CONN_NORMAL_WELL_SEGMENT_ID;
|
||||
if (segment_id == CONN_NORMAL_WELL_SEGMENT_VALUE)
|
||||
conn->segment_id = WELL_CONN_NORMAL_WELL_SEGMENT_ID;
|
||||
else
|
||||
conn->segment = segment_id;
|
||||
conn->segment_id = segment_id;
|
||||
|
||||
return conn;
|
||||
} 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) {
|
||||
return well_conn_alloc__(i , j , k , dir , open , segment , true );
|
||||
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_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) {
|
||||
return well_conn_alloc__(i , j , k , dir , open , segment , false);
|
||||
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_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 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 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 open;
|
||||
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
|
||||
@ -298,8 +298,8 @@ bool well_conn_open( const well_conn_type * conn ) {
|
||||
}
|
||||
|
||||
|
||||
int well_conn_get_segment( const well_conn_type * conn ) {
|
||||
return conn->segment;
|
||||
int well_conn_get_segment_id( const well_conn_type * conn ) {
|
||||
return conn->segment_id;
|
||||
}
|
||||
|
||||
bool well_conn_fracture_connection( const well_conn_type * conn) {
|
||||
|
@ -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) {
|
||||
util_abort("%s: fatal internal error - tried to create well_segment instance without RSEG keyword.\n",__func__);
|
||||
return NULL;
|
||||
} else {
|
||||
const int iseg_offset = header->nisegz * ( header->nsegmx * well_nr + segment_id);
|
||||
const int rseg_offset = header->nrsegz * ( header->nsegmx * well_nr + segment_id);
|
||||
int outlet_segment_id = ecl_kw_iget_int( iseg_kw , iseg_offset + ISEG_OUTLET_ITEM ) - 1;
|
||||
int branch_id = ecl_kw_iget_int( iseg_kw , iseg_offset + ISEG_BRANCH_ITEM ) - 1;
|
||||
const int iseg_offset = header->nisegz * ( header->nsegmx * well_nr + segment_index);
|
||||
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 ) - ECLIPSE_WELL_SEGMENT_OFFSET + WELL_SEGMENT_OFFSET ; // -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 );
|
||||
|
||||
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 ) {
|
||||
if (segment->branch_id == ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE)
|
||||
if (segment->branch_id == WELL_SEGMENT_BRANCH_INACTIVE_VALUE)
|
||||
return false;
|
||||
else
|
||||
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 ) {
|
||||
if (segment->branch_id == ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE)
|
||||
if (segment->branch_id == WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE)
|
||||
return true;
|
||||
else
|
||||
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 ) {
|
||||
if (segment->outlet_segment_id == ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE)
|
||||
if (segment->outlet_segment_id == WELL_SEGMENT_OUTLET_END_VALUE)
|
||||
return true;
|
||||
else
|
||||
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) {
|
||||
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 (!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__ );
|
||||
|
@ -65,7 +65,7 @@ int well_segment_collection_get_size( const well_segment_collection_type * segme
|
||||
void well_segment_collection_add( well_segment_collection_type * segment_collection , well_segment_type * segment) {
|
||||
int segment_id = well_segment_get_id( segment );
|
||||
int current_index = int_vector_safe_iget( segment_collection->segment_index_map , segment_id );
|
||||
if (current_index >= 0)
|
||||
if (current_index >= 0)
|
||||
vector_iset_owned_ref( segment_collection->__segment_storage , current_index , segment , well_segment_free__);
|
||||
else {
|
||||
int new_index = vector_get_size(segment_collection->__segment_storage);
|
||||
@ -111,10 +111,11 @@ int well_segment_collection_load_from_kw( well_segment_collection_type * segment
|
||||
int segments_added = 0;
|
||||
|
||||
if (segment_well_nr != IWEL_SEGMENTED_WELL_NR_NORMAL_VALUE) {
|
||||
int segment_id;
|
||||
for (segment_id = 0; segment_id < rst_head->nsegmx; segment_id++) {
|
||||
well_segment_type * segment = well_segment_alloc_from_kw( iseg_kw , rseg_kw , rst_head , segment_well_nr , segment_id );
|
||||
|
||||
int segment_index;
|
||||
for (segment_index = 0; segment_index < rst_head->nsegmx; segment_index++) {
|
||||
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 )) {
|
||||
well_segment_collection_add( segment_collection , segment );
|
||||
segments_added++;
|
||||
@ -122,7 +123,6 @@ int well_segment_collection_load_from_kw( well_segment_collection_type * segment
|
||||
well_segment_free( segment );
|
||||
}
|
||||
}
|
||||
|
||||
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++) {
|
||||
well_conn_type * conn = well_conn_collection_iget( connections , iconn );
|
||||
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_add_connection( segment , grid_name , conn );
|
||||
}
|
||||
@ -167,3 +167,6 @@ void well_segment_collection_add_branches( const well_segment_collection_type *
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -92,7 +92,7 @@ int main(int argc , char ** argv) {
|
||||
test_assert_int_equal( i , well_conn_get_i( 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( 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_int_equal( dir , well_conn_get_dir( 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( j , well_conn_get_j( 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_int_equal( dir , well_conn_get_dir( conn ));
|
||||
test_assert_true( well_conn_MSW( conn ));
|
||||
|
@ -43,7 +43,7 @@ int main(int argc , char ** argv) {
|
||||
{
|
||||
int segment_id = 78;
|
||||
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);
|
||||
|
||||
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;
|
||||
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 branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE;
|
||||
int outlet_segment_id = WELL_SEGMENT_OUTLET_END_VALUE;
|
||||
int branch_nr = WELL_SEGMENT_BRANCH_INACTIVE_VALUE;
|
||||
well_segment_type * ws = well_segment_alloc(89 , outlet_segment_id , branch_nr, rseg_data);
|
||||
|
||||
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;
|
||||
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);
|
||||
|
||||
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;
|
||||
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);
|
||||
|
||||
test_assert_false( well_segment_link( ws , outlet ));
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include <ert/ecl/ecl_util.h>
|
||||
|
||||
|
||||
#include <ert/ecl_well/well_const.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 );
|
||||
|
||||
{
|
||||
int outlet_segment_id = ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE;
|
||||
int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE;
|
||||
int outlet_segment_id = WELL_SEGMENT_OUTLET_END_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_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 branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE;
|
||||
int outlet_segment_id = WELL_SEGMENT_OUTLET_END_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_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 branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE;
|
||||
int outlet_segment_id = WELL_SEGMENT_OUTLET_END_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_collection_add( sc , ws );
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <ert/ecl/ecl_util.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_conn.h>
|
||||
#include <ert/ecl_well/well_conn_collection.h>
|
||||
@ -36,7 +37,7 @@ int main(int argc , char ** argv) {
|
||||
{
|
||||
int segment_id = 78;
|
||||
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_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);
|
||||
|
@ -52,11 +52,12 @@ int main(int argc , char ** argv) {
|
||||
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.
|
||||
if (seg_well_nr >= 0) {
|
||||
int segment_id;
|
||||
int segment_index;
|
||||
int segment_count = 0;
|
||||
|
||||
for (segment_id = 0; segment_id < rst_head->nsegmx; segment_id++) {
|
||||
well_segment_type * segment = well_segment_alloc_from_kw( iseg_kw , rseg_kw , rst_head , seg_well_nr , segment_id );
|
||||
for (segment_index = 0; segment_index < rst_head->nsegmx; segment_index++) {
|
||||
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 ));
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
include(cmake/find_python_module.cmake)
|
||||
if (ERT_BUILD_GUI)
|
||||
FIND_PACKAGE(PythonInterp 2.7 REQUIRED)
|
||||
FIND_PACKAGE(PythonInterp 2.6 REQUIRED)
|
||||
find_python_module(PyQt4 REQUIRED)
|
||||
else()
|
||||
FIND_PACKAGE(PythonInterp 2.6 REQUIRED)
|
||||
|
@ -1,6 +1,12 @@
|
||||
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")
|
||||
|
Loading…
Reference in New Issue
Block a user