Exemplo n.º 1
0
bool ecl_sum_vector_add_key( ecl_sum_vector_type * ecl_sum_vector, const char * key){
  if (ecl_sum_has_general_var( ecl_sum_vector->ecl_sum , key)) {
    const smspec_node_type * node = ecl_sum_get_general_var_node( ecl_sum_vector->ecl_sum , key );
    int params_index = smspec_node_get_params_index( node );
    bool is_rate_key = smspec_node_is_rate( node);

    int_vector_append(ecl_sum_vector->node_index_list, params_index);
    bool_vector_append(ecl_sum_vector->is_rate_list, is_rate_key);
    return true;
  } else
    return false;
}
Exemplo n.º 2
0
double ecl_sum_data_get_from_sim_time( const ecl_sum_data_type * data , time_t sim_time , const smspec_node_type * smspec_node) {
  int params_index = smspec_node_get_params_index( smspec_node );
  if (smspec_node_is_rate( smspec_node )) {
    int time_index = ecl_sum_data_get_index_from_sim_time( data , sim_time );
    return ecl_sum_data_iget( data , time_index , params_index);
  } else {
    /* Interpolated lookup based on two (hopefully) consecutive ministeps. */
    double weight1 , weight2;
    int    time_index1 , time_index2;
    

    ecl_sum_data_init_interp_from_sim_time( data , sim_time , &time_index1 , &time_index2 , &weight1 , &weight2);
    return ecl_sum_data_interp_get( data , time_index1 , time_index2 , weight1 , weight2 , params_index);
  }
}
Exemplo n.º 3
0
void ecl_sum_vector_add_keys( ecl_sum_vector_type * ecl_sum_vector, const char * pattern){
    stringlist_type * keylist = ecl_sum_alloc_matching_general_var_list(ecl_sum_vector->ecl_sum , pattern);

    int num_keywords = stringlist_get_size(keylist);
    int i;
    for(i = 0; i < num_keywords ;i++){
        const char * key = stringlist_iget(keylist, i);
        const smspec_node_type * node = ecl_sum_get_general_var_node( ecl_sum_vector->ecl_sum , key );
        int params_index = smspec_node_get_params_index( node );
        bool is_rate_key = smspec_node_is_rate( node);

        int_vector_append(ecl_sum_vector->node_index_list, params_index);
        bool_vector_append(ecl_sum_vector->is_rate_list, is_rate_key);
    }
    stringlist_free(keylist);
}
Exemplo n.º 4
0
Arquivo: ecl_sum.c Projeto: flikka/ert
bool ecl_sum_var_is_rate( const ecl_sum_type * ecl_sum , const char * gen_key) {
  const smspec_node_type * node = ecl_sum_get_general_var_node( ecl_sum , gen_key );
  return smspec_node_is_rate( node );
}