diff --git a/lib/include/resdata/rd_rft_file.hpp b/lib/include/resdata/rd_rft_file.hpp index b3c4047a5..8dec02842 100644 --- a/lib/include/resdata/rd_rft_file.hpp +++ b/lib/include/resdata/rd_rft_file.hpp @@ -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); @@ -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); diff --git a/lib/include/resdata/rd_rsthead.hpp b/lib/include/resdata/rd_rsthead.hpp index e55398121..a8596f4b1 100644 --- a/lib/include/resdata/rd_rsthead.hpp +++ b/lib/include/resdata/rd_rsthead.hpp @@ -68,10 +68,7 @@ rd_rsthead_type *rd_rsthead_alloc_from_kw(int report_step, const rd_kw_type *logihead_kw); rd_rsthead_type *rd_rsthead_alloc(const rd_file_view_type *rst_file, int report_step); -rd_rsthead_type *rd_rsthead_alloc_empty(void); time_t rd_rsthead_date(const rd_kw_type *intehead_kw); -void rd_rsthead_fprintf(const rd_rsthead_type *header, FILE *stream); -void rd_rsthead_fprintf_struct(const rd_rsthead_type *header, FILE *stream); bool rd_rsthead_equal(const rd_rsthead_type *header1, const rd_rsthead_type *header2); double rd_rsthead_get_sim_days(const rd_rsthead_type *header); diff --git a/lib/include/resdata/smspec_node.h b/lib/include/resdata/smspec_node.h index 9c16accfe..91342f43c 100644 --- a/lib/include/resdata/smspec_node.h +++ b/lib/include/resdata/smspec_node.h @@ -49,66 +49,11 @@ typedef enum { #define SMSPEC_TYPE_ID 61550451 -char *smspec_alloc_block_ijk_key(const char *join_string, const char *keyword, - int i, int j, int k); -char *smspec_alloc_completion_ijk_key(const char *join_string, - const char *keyword, const char *wgname, - int i, int j, int k); -char *smspec_alloc_completion_num_key(const char *join_string, - const char *keyword, const char *wgname, - int num); -char *smspec_alloc_group_key(const char *join_string, const char *keyword, - const char *wgname); char *smspec_alloc_well_key(const char *join_string, const char *keyword, const char *wgname); -char *smspec_alloc_region_key(const char *join_string, const char *keyword, - int num); -char *smspec_alloc_region_2_region_r1r2_key(const char *join_string, - const char *keyword, int r1, - int r2); -char *smspec_alloc_region_2_region_num_key(const char *join_string, - const char *keyword, int num); -char *smspec_alloc_segment_key(const char *join_string, const char *keyword, - const char *wgname, int num); -char *smspec_alloc_block_num_key(const char *join_string, const char *keyword, - int num); -char *smspec_alloc_local_well_key(const char *join_string, const char *keyword, - const char *lgr_name, const char *wgname); -char *smspec_alloc_local_block_key(const char *join_string, const char *keyword, - const char *lgr_name, int i, int j, int k); -char *smspec_alloc_local_completion_key(const char *join_string, - const char *keyword, - const char *lgr_name, - const char *wgname, int i, int j, - int k); - bool smspec_node_identify_total(const char *keyword, rd_smspec_var_type var_type); bool smspec_node_identify_rate(const char *keyword); - -bool smspec_node_equal(const void *node1, const void *node2); - -void smspec_node_init(void *smspec_node, rd_smspec_var_type var_type, - const char *wgname, const char *keyword, const char *unit, - const char *key_join_string, const int grid_dims[3], - int num); - -void *smspec_node_alloc(int param_index, const char *keyword, - const char *wgname, int num, const char *unit, - const int grid_dims[3], float default_value, - const char *key_join_string); - -void *smspec_node_alloc_lgr(rd_smspec_var_type var_type, const char *wgname, - const char *keyword, const char *unit, - const char *lgr, const char *key_join_string, - int lgr_i, int lgr_j, int lgr_k, int param_index, - float default_value); - -void *smspec_node_alloc_copy(const void *); - -void smspec_node_free(void *index); -void smspec_node_free__(void *arg); -void smspec_node_set_params_index(void *smspec_node, int params_index); int smspec_node_get_params_index(const void *smspec_node); const char *smspec_node_get_gen_key1(const void *smspec_node); const char *smspec_node_get_gen_key2(const void *smspec_node); @@ -121,21 +66,10 @@ bool smspec_node_is_rate(const void *smspec_node); bool smspec_node_is_total(const void *smspec_node); bool smspec_node_is_historical(const void *smspec_node); bool smspec_node_need_nums(const void *smspec_node); -void smspec_node_fprintf(const void *smspec_node, FILE *stream); - float smspec_node_get_default(const void *smspec_node); -const int *smspec_node_get_ijk(const void *smpsec_node); -const char *smspec_node_get_lgr_name(const void *smpsec_node); -const int *smspec_node_get_lgr_ijk(const void *smpsec_node); - -int smspec_node_get_R1(const void *smpsec_node); -int smspec_node_get_R2(const void *smpsec_node); - bool smspec_node_lt(const void *node1, const void *node2); -bool smspec_node_gt(const void *node1, const void *node2); int smspec_node_cmp(const void *node1, const void *node2); -int smspec_node_cmp__(const void *node1, const void *node2); #ifdef __cplusplus } diff --git a/lib/include/resdata/well/well_info.hpp b/lib/include/resdata/well/well_info.hpp index 11d1768e1..a8a849cc5 100644 --- a/lib/include/resdata/well/well_info.hpp +++ b/lib/include/resdata/well/well_info.hpp @@ -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, @@ -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 diff --git a/lib/include/resdata/well/well_state.hpp b/lib/include/resdata/well/well_state.hpp index b61b1f1ae..c7eab2536 100644 --- a/lib/include/resdata/well/well_state.hpp +++ b/lib/include/resdata/well/well_state.hpp @@ -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 * diff --git a/lib/resdata/rd_rft_file.cpp b/lib/resdata/rd_rft_file.cpp index 72906302e..dfd441799 100644 --- a/lib/resdata/rd_rft_file.cpp +++ b/lib/resdata/rd_rft_file.cpp @@ -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); @@ -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 @@ -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)) @@ -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. @@ -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]; @@ -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(). */ @@ -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); diff --git a/lib/resdata/rd_rsthead.cpp b/lib/resdata/rd_rsthead.cpp index dd6ef0fa6..eccacf08f 100644 --- a/lib/resdata/rd_rsthead.cpp +++ b/lib/resdata/rd_rsthead.cpp @@ -106,47 +106,6 @@ rd_rsthead_type *rd_rsthead_alloc(const rd_file_view_type *rst_view, logihead_kw); } -rd_rsthead_type *rd_rsthead_alloc_empty() { - rd_rsthead_type *rsthead = (rd_rsthead_type *)util_malloc(sizeof *rsthead); - - rsthead->day = 0; - rsthead->month = 0; - rsthead->year = 0; - rsthead->version = 0; - rsthead->phase_sum = 0; - - rsthead->nx = 0; - rsthead->ny = 0; - rsthead->nz = 0; - rsthead->nactive = 0; - - rsthead->nwells = 0; - rsthead->niwelz = 0; - rsthead->nzwelz = 0; - - rsthead->nsconz = 0; - rsthead->niconz = 0; - rsthead->ncwmax = 0; - - rsthead->nisegz = 0; - rsthead->nsegmx = 0; - rsthead->nswlmx = 0; - rsthead->nrsegz = 0; - - rsthead->sim_time = 0; - - rsthead->dualp = false; - rsthead->sim_days = 0.0; - - return rsthead; -} - -void rd_rsthead_fprintf(const rd_rsthead_type *header, FILE *stream) { - fprintf(stream, "nx %d \n", header->nx); - fprintf(stream, "nwells %d \n", header->nwells); - fprintf(stream, "niwelz %d \n\n", header->niwelz); -} - bool rd_rsthead_equal(const rd_rsthead_type *header1, const rd_rsthead_type *header2) { bool equal = true; @@ -178,31 +137,6 @@ bool rd_rsthead_equal(const rd_rsthead_type *header1, return equal; } -void rd_rsthead_fprintf_struct(const rd_rsthead_type *header, FILE *stream) { - fprintf(stream, "{.day = %d,\n", header->day); - fprintf(stream, ".year = %d,\n", header->year); - fprintf(stream, ".month = %d,\n", header->month); - fprintf(stream, ".sim_time = %ld,\n", header->sim_time); - fprintf(stream, ".version = %d,\n", header->version); - fprintf(stream, ".phase_sum = %d,\n", header->phase_sum); - fprintf(stream, ".nx = %d,\n", header->nx); - fprintf(stream, ".ny = %d,\n", header->ny); - fprintf(stream, ".nz = %d,\n", header->nz); - fprintf(stream, ".nactive = %d,\n", header->nactive); - fprintf(stream, ".nwells = %d,\n", header->nwells); - fprintf(stream, ".niwelz = %d,\n", header->niwelz); - fprintf(stream, ".nzwelz = %d,\n", header->nzwelz); - fprintf(stream, ".niconz = %d,\n", header->niconz); - fprintf(stream, ".ncwmax = %d,\n", header->ncwmax); - fprintf(stream, ".nisegz = %d,\n", header->nisegz); - fprintf(stream, ".nsegmx = %d,\n", header->nsegmx); - fprintf(stream, ".nswlmx = %d,\n", header->nswlmx); - fprintf(stream, ".nlbrmx = %d,\n", header->nlbrmx); - fprintf(stream, ".nilbrz = %d,\n", header->nilbrz); - fprintf(stream, ".dualp = %d,\n", header->dualp); - fprintf(stream, ".sim_days = %g};\n", header->sim_days); -} - void rd_rsthead_free(rd_rsthead_type *rsthead) { free(rsthead); } int rd_rsthead_get_nxconz(const rd_rsthead_type *rsthead) { diff --git a/lib/resdata/smspec_node.cpp b/lib/resdata/smspec_node.cpp index 72390d5b0..ea4d92ed0 100644 --- a/lib/resdata/smspec_node.cpp +++ b/lib/resdata/smspec_node.cpp @@ -1308,12 +1308,6 @@ int smspec_node::cmp(const smspec_node &node2) const { /************************************** OLD API functions ***********************''''' */ -void smspec_node_free(void *index) { - delete static_cast(index); -} - -void smspec_node_free__(void *arg) { smspec_node_free(arg); } - float smspec_node_get_default(const void *smspec_node) { return static_cast(smspec_node)->get_default(); } @@ -1323,10 +1317,6 @@ int smspec_node_get_params_index(const void *smspec_node) { ->get_params_index(); } -// void smspec_node_set_params_index( void * smspec_node , int params_index) { -// static_cast(smspec_node)->set_params_index( params_index ); -// } - const char *smspec_node_get_gen_key1(const void *smspec_node) { return static_cast(smspec_node)->get_gen_key1(); } @@ -1367,48 +1357,15 @@ const char *smspec_node_get_unit(const void *smspec_node) { return static_cast(smspec_node)->get_unit(); } -// Will be garbage for smspec_nodes which do not have i,j,k -const int *smspec_node_get_ijk(const void *smspec_node) { - return static_cast(smspec_node)->get_ijk().data(); -} - -// Will be NULL for smspec_nodes which are not related to an LGR. -const char *smspec_node_get_lgr_name(const void *smspec_node) { - return static_cast(smspec_node)->get_lgr_name(); -} - -// Will be garbage for smspec_nodes which are not related to an LGR. -const int *smspec_node_get_lgr_ijk(const void *smspec_node) { - return static_cast(smspec_node) - ->get_lgr_ijk() - .data(); -} - -int smspec_node_get_R1(const void *smspec_node) { - return static_cast(smspec_node)->get_R1(); -} - -int smspec_node_get_R2(const void *smspec_node) { - return static_cast(smspec_node)->get_R2(); -} - bool smspec_node_need_nums(const void *smspec_node) { return static_cast(smspec_node)->need_nums(); } -void smspec_node_fprintf(const void *smspec_node, FILE *stream) { - static_cast(smspec_node)->fprintf__(stream); -} - int smspec_node_cmp(const void *node1, const void *node2) { return rd::smspec_node::cmp(static_cast(node1), static_cast(node2)); } -int smspec_node_cmp__(const void *node1, const void *node2) { - return smspec_node_cmp(node1, node2); -} - void *smspec_node_alloc(int param_index, const char *keyword, const char *wgname, int num, const char *unit, const int grid_dims[3], float default_value, @@ -1424,28 +1381,6 @@ void *smspec_node_alloc(int param_index, const char *keyword, return node; } -void *smspec_node_alloc_lgr(rd_smspec_var_type var_type, const char *wgname, - const char *keyword, const char *unit, - const char *lgr, const char *key_join_string, - int lgr_i, int lgr_j, int lgr_k, int param_index, - float default_value) { - - return new rd::smspec_node(param_index, keyword, wgname, unit, lgr, lgr_i, - lgr_j, lgr_k, default_value, key_join_string); -} - -bool smspec_node_equal(const void *node1, const void *node2) { - return rd::smspec_node::cmp(static_cast(node1), - static_cast(node2)) == - 0; -} - -bool smspec_node_gt(const void *node1, const void *node2) { - return rd::smspec_node::cmp(static_cast(node1), - static_cast(node2)) > - 0; -} - bool smspec_node_lt(const void *node1, const void *node2) { return rd::smspec_node::cmp(static_cast(node1), static_cast(node2)) < diff --git a/lib/resdata/well_info.cpp b/lib/resdata/well_info.cpp index 07bfcd20c..fc1f6aa7a 100644 --- a/lib/resdata/well_info.cpp +++ b/lib/resdata/well_info.cpp @@ -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. @@ -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; @@ -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); } @@ -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++) { @@ -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); } @@ -353,19 +352,6 @@ 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) { @@ -373,18 +359,13 @@ well_info_get_state_from_report(const well_info_type *well_info, 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(); } diff --git a/lib/resdata/well_state.cpp b/lib/resdata/well_state.cpp index 8c5e1955c..07f6c19d2 100644 --- a/lib/resdata/well_state.cpp +++ b/lib/resdata/well_state.cpp @@ -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); @@ -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(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;