/* Currently only comparison based on connection length along PLT is supported. */ int ecl_rft_cell_cmp( const ecl_rft_cell_type * cell1 , const ecl_rft_cell_type * cell2) { double val1 = ecl_rft_cell_get_connection_start( cell1 ); double val2 = ecl_rft_cell_get_connection_start( cell2 ); if (val1 < val2) return -1; else if (val1 == val2) return 0; else return 1; }
void test_plt_msw( const char * plt_file ) { ecl_rft_file_type * plt = ecl_rft_file_alloc( plt_file ); ecl_rft_node_type * plt_node = ecl_rft_file_iget_node( plt , 11 ); test_assert_true( ecl_rft_node_is_PLT( plt_node )); test_assert_true( ecl_rft_node_is_MSW( plt_node )); test_assert_int_equal( 22 , ecl_rft_node_get_size( plt_node )); ecl_rft_node_inplace_sort_cells( plt_node ); { int i; for (i=1; i < ecl_rft_node_get_size( plt_node ); i++) { const ecl_rft_cell_type * prev_cell = ecl_rft_node_iget_cell( plt_node , i - 1); const ecl_rft_cell_type * this_cell = ecl_rft_node_iget_cell( plt_node , i ); test_assert_true( ecl_rft_cell_get_connection_start( prev_cell ) < ecl_rft_cell_get_connection_start( this_cell )); test_assert_true( ecl_rft_cell_get_connection_end( prev_cell ) < ecl_rft_cell_get_connection_end( this_cell )); } } ecl_rft_file_free( plt ); }