ecl_sum_tstep_type * ecl_sum_data_add_new_tstep( ecl_sum_data_type * data , int report_step , double sim_days) { int ministep_nr = vector_get_size( data->data ); ecl_sum_tstep_type * tstep = ecl_sum_tstep_alloc_new( report_step , ministep_nr , sim_days , data->smspec ); ecl_sum_tstep_type * prev_tstep = NULL; if (vector_get_size( data->data ) > 0) prev_tstep = vector_get_last( data->data ); ecl_sum_data_append_tstep__( data , ministep_nr , tstep ); { bool rebuild_index = true; /* In the simple case that we just add another timestep to the currently active report_step, we do a limited update of the index, otherwise we call ecl_sum_data_build_index() to get a full recalculation of the index. */ if (prev_tstep != NULL) { if (ecl_sum_tstep_get_report( prev_tstep ) == ecl_sum_tstep_get_report( tstep )) { // Same report step if (ecl_sum_tstep_get_sim_days( prev_tstep ) < ecl_sum_tstep_get_sim_days( tstep )) { // This tstep will become the new latest tstep int internal_index = vector_get_size( data->data ) - 1; ecl_sum_data_update_end_info( data ); int_vector_iset( data->report_last_index , report_step , internal_index ); rebuild_index = false; } } } if (rebuild_index) ecl_sum_data_build_index( data ); } ecl_smspec_lock( data->smspec ); return tstep; }
const config_content_node_type * config_content_item_get_last_node_const(const config_content_item_type * item) { return vector_get_last( item->nodes ); }
const char * stringlist_get_last( const stringlist_type * stringlist ) { return vector_get_last( stringlist->strings ); }