예제 #1
0
static ecl_subsidence_survey_type * ecl_subsidence_survey_alloc_PRESSURE(ecl_subsidence_type * ecl_subsidence ,
                                                                         const ecl_file_view_type * restart_view ,
                                                                         const char * name ) {

  ecl_subsidence_survey_type * survey = ecl_subsidence_survey_alloc_empty( ecl_subsidence , name );
  ecl_grid_cache_type * grid_cache = ecl_subsidence->grid_cache;
  const int * global_index = ecl_grid_cache_get_global_index( grid_cache );
  const int size = ecl_grid_cache_get_size( grid_cache );
  int active_index;
  ecl_kw_type * init_porv_kw = ecl_file_iget_named_kw( ecl_subsidence->init_file , PORV_KW , 0); /*Global indexing*/
  ecl_kw_type * pressure_kw = ecl_file_view_iget_named_kw( restart_view , PRESSURE_KW , 0); /*Active indexing*/

  for (active_index = 0; active_index < size; active_index++){
    survey->porv[ active_index ] = ecl_kw_iget_float( init_porv_kw , global_index[active_index] );
    survey->pressure[ active_index ] = ecl_kw_iget_float( pressure_kw , active_index );
  }
  return survey;
}
예제 #2
0
static ecl_grav_survey_type * ecl_grav_survey_alloc_PORMOD(ecl_grav_type * ecl_grav , 
                                                           const ecl_file_type * restart_file , 
                                                           const char * name ) {
  ecl_grid_cache_type * grid_cache = ecl_grav->grid_cache;
  ecl_grav_survey_type * survey = ecl_grav_survey_alloc_empty( ecl_grav , name , GRAV_CALC_PORMOD);
  ecl_kw_type * init_porv_kw    = ecl_file_iget_named_kw( ecl_grav->init_file    , PORV_KW   , 0 );  /* Global indexing */
  ecl_kw_type * pormod_kw       = ecl_file_iget_named_kw( restart_file , PORMOD_KW , 0 );            /* Active indexing */
  const int size                = ecl_grid_cache_get_size( grid_cache ); 
  const int * global_index      = ecl_grid_cache_get_global_index( grid_cache );
  int active_index;

  for (active_index = 0; active_index < size; active_index++) 
    survey->porv[ active_index ] = ecl_kw_iget_float( pormod_kw , active_index ) * ecl_kw_iget_float( init_porv_kw , global_index[active_index] );
  
  ecl_grav_survey_add_phases( ecl_grav , survey , restart_file , GRAV_CALC_PORMOD);
  
  return survey;
}