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 8, 2024
1 parent 9bc4d88 commit 00bf689
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 53 deletions.
19 changes: 0 additions & 19 deletions lib/include/resdata/well/well_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ extern "C" {
typedef struct well_info_struct well_info_type;

well_info_type *well_info_alloc(const rd_grid_type *grid);
void well_info_add_UNRST_wells2(well_info_type *well_info,
rd_file_view_type *rst_view,
bool load_segment_information);
void well_info_add_UNRST_wells(well_info_type *well_info,
rd_file_type *rst_file,
bool load_segment_information);
void well_info_add_wells(well_info_type *well_info, rd_file_type *rst_file,
int report_nr, bool load_segment_information);
void well_info_add_wells2(well_info_type *well_info,
rd_file_view_type *rst_view, int report_nr,
bool load_segment_information);
void well_info_load_rstfile(well_info_type *well_info, const char *filename,
bool load_segment_information);
void well_info_load_rst_resfile(well_info_type *well_info,
Expand All @@ -38,17 +27,9 @@ const char *well_info_iget_well_name(const well_info_type *well_info,
int well_index);
bool well_info_has_well(well_info_type *well_info, const char *well_name);

well_state_type *well_info_get_state_from_time(const well_info_type *well_info,
const char *well_name,
time_t sim_time);
well_state_type *
well_info_get_state_from_report(const well_info_type *well_info,
const char *well_name, int report_step);
well_state_type *well_info_iget_state(const well_info_type *well_info,
const char *well_name, int time_index);
well_state_type *well_info_iiget_state(const well_info_type *well_info,
int well_index, int time_index);

#ifdef __cplusplus
}
#endif
Expand Down
49 changes: 15 additions & 34 deletions lib/resdata/well_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,8 @@
well_info_get_ts() to get the full timeseries for one named well;
or one of the functions:
- well_info_get_state_from_time()
- well_info_get_state_from_report()
- well_info_iget_state()
- well_info_iiget_state()
4. well_info_free() before you go home.
Expand Down Expand Up @@ -256,9 +254,9 @@ static void well_info_add_state(well_info_type *well_info,
determine the number of wells.
*/

void well_info_add_wells2(well_info_type *well_info,
rd_file_view_type *rst_view, int report_nr,
bool load_segment_information) {
static void well_info_add_wells2(well_info_type *well_info,
rd_file_view_type *rst_view, int report_nr,
bool load_segment_information) {
bool close_stream = rd_file_view_drop_flag(rst_view, RD_FILE_CLOSE_STREAM);
rd_rsthead_type *global_header = rd_rsthead_alloc(rst_view, report_nr);
int well_nr;
Expand All @@ -274,8 +272,9 @@ void well_info_add_wells2(well_info_type *well_info,
rd_file_view_add_flag(rst_view, RD_FILE_CLOSE_STREAM);
}

void well_info_add_wells(well_info_type *well_info, rd_file_type *rst_file,
int report_nr, bool load_segment_information) {
static void well_info_add_wells(well_info_type *well_info,
rd_file_type *rst_file, int report_nr,
bool load_segment_information) {
well_info_add_wells2(well_info, rd_file_get_active_view(rst_file),
report_nr, load_segment_information);
}
Expand All @@ -286,9 +285,9 @@ void well_info_add_wells(well_info_type *well_info, rd_file_type *rst_file,
not have the SEQNUM keyword.
*/

void well_info_add_UNRST_wells2(well_info_type *well_info,
rd_file_view_type *rst_view,
bool load_segment_information) {
static void well_info_add_UNRST_wells2(well_info_type *well_info,
rd_file_view_type *rst_view,
bool load_segment_information) {
int num_blocks = rd_file_view_get_num_named_kw(rst_view, SEQNUM_KW);
int block_nr;
for (block_nr = 0; block_nr < num_blocks; block_nr++) {
Expand All @@ -306,9 +305,9 @@ void well_info_add_UNRST_wells2(well_info_type *well_info,
}
}

void well_info_add_UNRST_wells(well_info_type *well_info,
rd_file_type *rst_file,
bool load_segment_information) {
static void well_info_add_UNRST_wells(well_info_type *well_info,
rd_file_type *rst_file,
bool load_segment_information) {
well_info_add_UNRST_wells2(well_info, rd_file_get_global_view(rst_file),
load_segment_information);
}
Expand Down Expand Up @@ -353,38 +352,20 @@ void well_info_free(well_info_type *well_info) {
delete well_info;
}

int well_info_get_well_size(const well_info_type *well_info,
const char *well_name) {
well_ts_type *well_ts = well_info_get_ts(well_info, well_name);
return well_ts_get_size(well_ts);
}

well_state_type *well_info_get_state_from_time(const well_info_type *well_info,
const char *well_name,
time_t sim_time) {
well_ts_type *well_ts = well_info_get_ts(well_info, well_name);
return well_ts_get_state_from_sim_time(well_ts, sim_time);
}

well_state_type *
well_info_get_state_from_report(const well_info_type *well_info,
const char *well_name, int report_step) {
well_ts_type *well_ts = well_info_get_ts(well_info, well_name);
return well_ts_get_state_from_report(well_ts, report_step);
}

well_state_type *well_info_iget_state(const well_info_type *well_info,
const char *well_name, int time_index) {
static well_state_type *well_info_iget_state(const well_info_type *well_info,
const char *well_name,
int time_index) {
well_ts_type *well_ts = well_info_get_ts(well_info, well_name);
return well_ts_iget_state(well_ts, time_index);
}

well_state_type *well_info_iiget_state(const well_info_type *well_info,
int well_index, int time_index) {
const std::string &well_name = well_info->well_names[well_index];
return well_info_iget_state(well_info, well_name.c_str(), time_index);
}

int well_info_get_num_wells(const well_info_type *well_info) {
return well_info->well_names.size();
}
Expand Down

0 comments on commit 00bf689

Please sign in to comment.