Skip to content

Commit

Permalink
Remove unused functions in rd_rft_file
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Aug 14, 2024
1 parent eafb79a commit 4d5451d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
10 changes: 0 additions & 10 deletions lib/include/resdata/rd_rft_file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,10 @@ extern "C" {

typedef struct rd_rft_file_struct rd_rft_file_type;

char *rd_rft_file_alloc_case_filename(const char *case_input);
const char *rd_rft_file_get_filename(const rd_rft_file_type *rft_file);
rd_rft_file_type *rd_rft_file_alloc_case(const char *case_input);
bool rd_rft_file_case_has_rft(const char *case_input);
rd_rft_file_type *rd_rft_file_alloc(const char *);
void rd_rft_file_free(rd_rft_file_type *);
void rd_rft_file_block(const rd_rft_file_type *, double, const char *, int,
const double *, int *, int *, int *);
void rd_rft_file_fprintf_rft_obs(const rd_rft_file_type *, double, const char *,
const char *, const char *, double);
rd_rft_node_type *rd_rft_file_get_node(const rd_rft_file_type *, const char *);

int rd_rft_file_get_size__(const rd_rft_file_type *rft_file,
const char *well_pattern, time_t recording_time);
int rd_rft_file_get_size(const rd_rft_file_type *rft_file);
Expand All @@ -35,12 +27,10 @@ rd_rft_node_type *rd_rft_file_iget_node(const rd_rft_file_type *rft_file,
int index);
rd_rft_node_type *rd_rft_file_iget_well_rft(const rd_rft_file_type *rft_file,
const char *well, int index);
bool rd_rft_file_has_well(const rd_rft_file_type *rft_file, const char *well);
int rd_rft_file_get_well_occurences(const rd_rft_file_type *rft_file,
const char *well);
stringlist_type *rd_rft_file_alloc_well_list(const rd_rft_file_type *rft_file);
int rd_rft_file_get_num_wells(const rd_rft_file_type *rft_file);
void rd_rft_file_free__(void *arg);
void rd_rft_file_update(const char *rft_file_name, rd_rft_node_type **nodes,
int num_nodes, ert_rd_unit_enum unit_set);

Expand Down
21 changes: 2 additions & 19 deletions lib/resdata/rd_rft_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ rd_rft_file_type *rd_rft_file_alloc(const char *filename) {
for the new name.
*/

char *rd_rft_file_alloc_case_filename(const char *case_input) {
static char *rd_rft_file_alloc_case_filename(const char *case_input) {
rd_file_enum file_type;
bool fmt_file;
file_type = rd_get_file_type(case_input, &fmt_file, NULL);
Expand Down Expand Up @@ -173,10 +172,6 @@ void rd_rft_file_free(rd_rft_file_type *rft_vector) {
delete rft_vector;
}

void rd_rft_file_free__(void *arg) {
rd_rft_file_free(rd_rft_file_safe_cast(arg));
}

/**
Will return the number of RFT nodes in the file. If @well != NULL
only wells matching @well be included. The @well variable can
Expand All @@ -190,7 +185,6 @@ void rd_rft_file_free__(void *arg) {
If recording_time >= only rft_nodes with recording time ==
@recording_time are included.
*/

int rd_rft_file_get_size__(const rd_rft_file_type *rft_file,
const char *well_pattern, time_t recording_time) {
if ((well_pattern == NULL) && (recording_time < 0))
Expand Down Expand Up @@ -221,15 +215,10 @@ int rd_rft_file_get_size__(const rd_rft_file_type *rft_file,
Returns the total number of rft nodes in the file, not caring if
the same well occurse many times and so on.
*/

int rd_rft_file_get_size(const rd_rft_file_type *rft_file) {
return rd_rft_file_get_size__(rft_file, NULL, -1);
}

const char *rd_rft_file_get_filename(const rd_rft_file_type *rft_file) {
return rft_file->filename.c_str();
}

/**
Return rft_node number 'i' in the rft_file - not caring when this
particular RFT is from, or which well it is.
Expand All @@ -238,7 +227,6 @@ const char *rd_rft_file_get_filename(const rd_rft_file_type *rft_file) {
go up in flames - use rd_file_get_size() first if you can not
handle that.
*/

rd_rft_node_type *rd_rft_file_iget_node(const rd_rft_file_type *rft_file,
int index) {
return rft_file->data[index];
Expand All @@ -264,7 +252,7 @@ rd_rft_node_type *rd_rft_file_iget_node(const rd_rft_file_type *rft_file,
If the rft_file does not have the well, or that occurence, the
function will go down in flames with util_abort(). Use
rd_rft_file_has_well() and rd_rft_file_get_well_occurences()
rd_rft_file_get_well_occurences()
first if you can not take util_abort().
*/

Expand Down Expand Up @@ -320,14 +308,9 @@ rd_rft_file_get_well_time_rft(const rd_rft_file_type *rft_file,
}
}

bool rd_rft_file_has_well(const rd_rft_file_type *rft_file, const char *well) {
return (rft_file->well_index.find(well) != rft_file->well_index.end());
}

/**
Returns the number of occurences of 'well' in rft_file.
*/

int rd_rft_file_get_well_occurences(const rd_rft_file_type *rft_file,
const char *well) {
const auto &pair_iter = rft_file->well_index.find(well);
Expand Down

0 comments on commit 4d5451d

Please sign in to comment.