Skip to content

Commit

Permalink
Remove unused well_state functions
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Aug 14, 2024
1 parent 83c101d commit b92484c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 30 deletions.
5 changes: 0 additions & 5 deletions lib/include/resdata/well/well_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ int well_state_get_well_nr(const well_state_type *well_state);

const well_conn_type *
well_state_get_global_wellhead(const well_state_type *well_state);
const well_conn_type *
well_state_iget_wellhead(const well_state_type *well_state, int grid_nr);
const well_conn_type *well_state_get_wellhead(const well_state_type *well_state,
const char *grid_name);

well_type_enum well_state_translate_rd_type_int(int int_type);

const well_conn_collection_type *
Expand Down
32 changes: 7 additions & 25 deletions lib/resdata/well_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ double well_state_get_volume_rate_si(const well_state_type *well_state) {
return well_state->volume_rate;
}

void well_state_add_wellhead(well_state_type *well_state,
const rd_rsthead_type *header,
const rd_kw_type *iwel_kw, int well_nr,
const char *grid_name, int grid_nr) {
static void well_state_add_wellhead(well_state_type *well_state,
const rd_rsthead_type *header,
const rd_kw_type *iwel_kw, int well_nr,
const char *grid_name, int grid_nr) {
well_conn_type *wellhead =
well_conn_alloc_wellhead(iwel_kw, header, well_nr);

Expand Down Expand Up @@ -623,27 +623,9 @@ time_t well_state_get_sim_time(const well_state_type *well_state) {
return well_state->valid_from_time;
}

/**
Will return NULL if no wellhead in this grid.
*/
const well_conn_type *
well_state_iget_wellhead(const well_state_type *well_state, int grid_nr) {
if (grid_nr < static_cast<int>(well_state->index_wellhead.size()))
return well_state->index_wellhead[grid_nr];
else
return NULL;
}

bool well_state_has_named_well_conn(const well_state_type *well_state,
const char *grid_name) {
const auto it = well_state->name_wellhead.find(grid_name);
if (it == well_state->name_wellhead.end())
return false;
return true;
}

const well_conn_type *well_state_get_wellhead(const well_state_type *well_state,
const char *grid_name) {
static const well_conn_type *
well_state_get_wellhead(const well_state_type *well_state,
const char *grid_name) {
const auto it = well_state->name_wellhead.find(grid_name);
if (it != well_state->name_wellhead.end())
return it->second;
Expand Down

0 comments on commit b92484c

Please sign in to comment.