Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused c code #949

Merged
merged 13 commits into from
Sep 2, 2024
13 changes: 0 additions & 13 deletions lib/geometry/geo_polygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,23 +132,10 @@ void geo_polygon_reset(geo_polygon_type *polygon) {
double_vector_reset(polygon->ycoord);
}

void geo_polygon_shift(geo_polygon_type *polygon, double x0, double y0) {
double_vector_shift(polygon->xcoord, x0);
double_vector_shift(polygon->ycoord, y0);
}

int geo_polygon_get_size(const geo_polygon_type *polygon) {
return double_vector_size(polygon->xcoord);
}

void geo_polygon_fprintf(const geo_polygon_type *polygon, FILE *stream) {
int i;
for (i = 0; i < double_vector_size(polygon->xcoord); i++)
fprintf(stream, "%10.3f %10.3f \n",
double_vector_iget(polygon->xcoord, i),
double_vector_iget(polygon->ycoord, i));
}

void geo_polygon_iget_xy(const geo_polygon_type *polygon, int index, double *x,
double *y) {
*x = double_vector_iget(polygon->xcoord, index);
Expand Down
5 changes: 0 additions & 5 deletions lib/geometry/geo_region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ void geo_region_free(geo_region_type *region) {
free(region);
}

void geo_region_free__(void *arg) {
geo_region_type *region = geo_region_safe_cast(arg);
geo_region_free(region);
}

static void geo_region_polygon_select__(geo_region_type *region,
const geo_polygon_type *polygon,
bool select_inside, bool select) {
Expand Down
11 changes: 0 additions & 11 deletions lib/geometry/geo_surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,6 @@ void geo_surface_fprintf_irap(const geo_surface_type *surface,
geo_surface_fprintf_irap__(surface, filename, zcoord);
}

void geo_surface_fprintf_irap_external_zcoord(const geo_surface_type *surface,
const char *filename,
const double *zcoord) {
geo_surface_fprintf_irap__(surface, filename, zcoord);
}

geo_surface_type *geo_surface_alloc_new(int nx, int ny, double xinc,
double yinc, double xstart,
double ystart, double angle) {
Expand Down Expand Up @@ -312,11 +306,6 @@ void geo_surface_free(geo_surface_type *surface) {
free(surface);
}

void geo_surface_free__(void *arg) {
geo_surface_type *surface = geo_surface_safe_cast(arg);
geo_surface_free(surface);
}

geo_pointset_type *geo_surface_get_pointset(const geo_surface_type *surface) {
return surface->pointset;
}
Expand Down
2 changes: 0 additions & 2 deletions lib/include/ert/geometry/geo_polygon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ bool geo_polygon_contains_point(const geo_polygon_type *polygon, double x,
bool geo_polygon_contains_point__(const geo_polygon_type *polygon, double x,
double y, bool force_edge_inside);
void geo_polygon_reset(geo_polygon_type *polygon);
void geo_polygon_fprintf(const geo_polygon_type *polygon, FILE *stream);
void geo_polygon_shift(geo_polygon_type *polygon, double x0, double y0);
void geo_polygon_close(geo_polygon_type *polygoon);
int geo_polygon_get_size(const geo_polygon_type *polygon);
void geo_polygon_iget_xy(const geo_polygon_type *polygon, int index, double *x,
Expand Down
1 change: 0 additions & 1 deletion lib/include/ert/geometry/geo_region.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ typedef struct geo_region_struct geo_region_type;
geo_region_type *geo_region_alloc(const geo_pointset_type *pointset,
bool preselect);
void geo_region_free(geo_region_type *region);
void geo_region_free__(void *arg);
void geo_region_reset(geo_region_type *region);
const int_vector_type *geo_region_get_index_list(geo_region_type *region);

Expand Down
4 changes: 0 additions & 4 deletions lib/include/ert/geometry/geo_surface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ bool geo_surface_equal_header(const geo_surface_type *surface1,
bool geo_surface_equal(const geo_surface_type *surface1,
const geo_surface_type *surface2);
void geo_surface_free(geo_surface_type *geo_surface);
void geo_surface_free__(void *arg);
geo_pointset_type *geo_surface_get_pointset(const geo_surface_type *surface);
geo_surface_type *geo_surface_fload_alloc_irap(const char *filename,
bool loadz);
Expand All @@ -27,9 +26,6 @@ double geo_surface_iget_zvalue(const geo_surface_type *surface, int index);
int geo_surface_get_size(const geo_surface_type *surface);
void geo_surface_fprintf_irap(const geo_surface_type *surface,
const char *filename);
void geo_surface_fprintf_irap_external_zcoord(const geo_surface_type *surface,
const char *filename,
const double *zcoord);
int geo_surface_get_nx(const geo_surface_type *surface);
int geo_surface_get_ny(const geo_surface_type *surface);
void geo_surface_iget_xy(const geo_surface_type *surface, int index, double *x,
Expand Down
2 changes: 0 additions & 2 deletions lib/include/resdata/fault_block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ void fault_block_export_cell(const fault_block_type *fault_block, int index,
void fault_block_assign_to_region(fault_block_type *fault_block, int region_id);
const int_vector_type *
fault_block_get_region_list(const fault_block_type *fault_block);
int fault_block_iget_j(const fault_block_type *fault_block, int index);
int fault_block_iget_i(const fault_block_type *fault_block, int index);
void fault_block_add_cell(fault_block_type *fault_block, int i, int j);
bool fault_block_trace_edge(const fault_block_type *block,
double_vector_type *x_list,
Expand Down
1 change: 0 additions & 1 deletion lib/include/resdata/fault_block_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ typedef struct fault_block_layer_struct fault_block_layer_type;
fault_block_layer_type *fault_block_layer_alloc(const rd_grid_type *grid,
int k);
void fault_block_layer_free(fault_block_layer_type *layer);
void fault_block_layer_free__(void *arg);
bool fault_block_layer_has_block(const fault_block_layer_type *layer,
int block_id);
void fault_block_layer_del_block(fault_block_layer_type *layer, int block_id);
Expand Down
7 changes: 0 additions & 7 deletions lib/include/resdata/fortio.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ typedef enum {

typedef struct fortio_struct fortio_type;

fortio_status_type fortio_check_buffer(FILE *stream, bool endian_flip,
size_t buffer_size);
fortio_status_type fortio_check_file(const char *filename, bool endian_flip);
bool fortio_looks_like_fortran_file(const char *, bool);
void fortio_copy_record(fortio_type *, fortio_type *, int, void *, bool *);
fortio_type *fortio_open_reader(const char *, bool fmt_file,
bool endian_flip_header);
fortio_type *fortio_open_writer(const char *, bool fmt_file,
Expand All @@ -61,14 +57,11 @@ int fortio_init_read(fortio_type *);
bool fortio_complete_read(fortio_type *, int record_size);
void fortio_init_write(fortio_type *, int);
void fortio_complete_write(fortio_type *, int record_size);
void fortio_fskip_buffer(fortio_type *, int);
int fortio_fskip_record(fortio_type *);
bool fortio_fread_buffer(fortio_type *, char *buffer, int buffer_size);
void fortio_fwrite_record(fortio_type *, const char *buffer, int buffer_size);
FILE *fortio_get_FILE(const fortio_type *);
void fortio_fflush(fortio_type *);
bool fortio_ftruncate_current(fortio_type *fortio);
bool fortio_is_fortio_file(fortio_type *);
void fortio_rewind(const fortio_type *fortio);
const char *fortio_filename_ref(const fortio_type *);
bool fortio_fmt_file(const fortio_type *);
Expand Down
3 changes: 0 additions & 3 deletions lib/include/resdata/layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ bool layer_iget_left_barrier(const layer_type *layer, int i, int j);
bool layer_iget_bottom_barrier(const layer_type *layer, int i, int j);
int layer_get_nx(const layer_type *layer);
int layer_get_ny(const layer_type *layer);
void layer_fprintf_cell(const layer_type *layer, int i, int j, FILE *stream);
void layer_fprintf(const layer_type *layer, FILE *stream);
void layer_fprintf_box(const layer_type *layer, FILE *stream, int i1, int i2,
int j1, int j2);
layer_type *layer_alloc(int nx, int ny);
void layer_free(layer_type *layer);
int layer_replace_cell_values(layer_type *layer, int old_value, int new_value);
Expand Down
13 changes: 0 additions & 13 deletions lib/include/resdata/rd_kw_grdecl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,12 @@ rd_kw_type *rd_kw_fscanf_alloc_grdecl_dynamic__(FILE *stream, const char *kw,
rd_kw_type *rd_kw_fscanf_alloc_grdecl_dynamic(FILE *stream, const char *kw,
rd_data_type);

rd_kw_type *rd_kw_fscanf_alloc_grdecl_data__(FILE *stream, bool strict,
int size, rd_data_type data_type);
rd_kw_type *rd_kw_fscanf_alloc_grdecl_data(FILE *stream, int size,
rd_data_type data_type);

rd_kw_type *rd_kw_fscanf_alloc_grdecl__(FILE *stream, const char *kw,
bool strict, int size,
rd_data_type data_type);
rd_kw_type *rd_kw_fscanf_alloc_grdecl(FILE *stream, const char *kw, int size,
rd_data_type data_type);

rd_kw_type *rd_kw_fscanf_alloc_current_grdecl__(FILE *stream, bool strict,
rd_data_type data_type);
rd_kw_type *rd_kw_fscanf_alloc_current_grdecl(FILE *stream,
rd_data_type data_type);

bool rd_kw_grdecl_fseek_next_kw(FILE *stream);
char *rd_kw_grdecl_alloc_next_header(FILE *stream);

void rd_kw_fprintf_grdecl(const rd_kw_type *rd_kw, FILE *stream);
void rd_kw_fprintf_grdecl__(const rd_kw_type *rd_kw, const char *special_header,
FILE *stream);
Expand Down
7 changes: 0 additions & 7 deletions lib/include/resdata/rd_rft_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@ typedef enum {

typedef struct rd_rft_node_struct rd_rft_node_type;

void rd_rft_node_inplace_sort_cells(rd_rft_node_type *rft_node);
const rd_rft_cell_type *rd_rft_node_iget_cell_sorted(rd_rft_node_type *rft_node,
int index);
const rd_rft_cell_type *rd_rft_node_iget_cell(const rd_rft_node_type *rft_node,
int index);
const rd_rft_cell_type *rd_rft_node_lookup_ijk(const rd_rft_node_type *rft_node,
int i, int j, int k);
void rd_rft_node_fprintf_rft_obs(const rd_rft_node_type *, double, const char *,
const char *, double);
rd_rft_node_type *rd_rft_node_alloc(const rd_file_view_type *rft_view);
void rd_rft_node_free(rd_rft_node_type *);
void rd_rft_node_free__(void *);
time_t rd_rft_node_get_date(const rd_rft_node_type *);
int rd_rft_node_get_size(const rd_rft_node_type *);
const char *rd_rft_node_get_well_name(const rd_rft_node_type *rft_node);
Expand All @@ -52,11 +48,8 @@ double rd_rft_node_iget_soil(const rd_rft_node_type *rft_node, int index);
void rd_rft_node_fwrite(const rd_rft_node_type *rft_node, fortio_type *fortio,
ert_rd_unit_enum unit_set);
double rd_rft_node_get_days(const rd_rft_node_type *rft_node);
int rd_rft_node_cmp(const rd_rft_node_type *n1, const rd_rft_node_type *n2);
bool rd_rft_node_lt(const rd_rft_node_type *n1, const rd_rft_node_type *n2);

void rd_rft_node_append_cell(rd_rft_node_type *rft_node,
rd_rft_cell_type *cell);
rd_rft_node_type *rd_rft_node_alloc_new(const char *well_name,
const char *data_type_string,
const time_t recording_date,
Expand Down
76 changes: 0 additions & 76 deletions lib/include/resdata/rd_smspec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,6 @@ typedef struct rd_smspec_struct rd_smspec_type;
#include <vector>
const std::vector<float> &
rd_smspec_get_params_default(const rd_smspec_type *rd_smspec);
const rd::smspec_node &rd_smspec_get_well_var_node(const rd_smspec_type *smspec,
const char *well,
const char *var);
const rd::smspec_node &
rd_smspec_get_group_var_node(const rd_smspec_type *smspec, const char *group,
const char *var);
const rd::smspec_node &
rd_smspec_get_field_var_node(const rd_smspec_type *smspec, const char *var);
const rd::smspec_node &
rd_smspec_get_region_var_node(const rd_smspec_type *rd_smspec,
const char *region_var, int region_nr);
const rd::smspec_node &
rd_smspec_get_misc_var_node(const rd_smspec_type *rd_smspec, const char *var);
const rd::smspec_node &
rd_smspec_get_block_var_node(const rd_smspec_type *rd_smspec,
const char *block_var, int block_nr);
const rd::smspec_node &
rd_smspec_get_block_var_node_ijk(const rd_smspec_type *rd_smspec,
const char *block_var, int i, int j, int k);
const rd::smspec_node &
rd_smspec_get_well_completion_var_node(const rd_smspec_type *rd_smspec,
const char *well, const char *var,
Expand Down Expand Up @@ -68,15 +49,7 @@ extern "C" {
int *rd_smspec_alloc_mapping(const rd_smspec_type *self,
const rd_smspec_type *other);
const int *rd_smspec_get_index_map(const rd_smspec_type *smspec);
rd_smspec_var_type rd_smspec_iget_var_type(const rd_smspec_type *smspec,
int index);
bool rd_smspec_needs_num(rd_smspec_var_type var_type);
bool rd_smspec_needs_wgname(rd_smspec_var_type var_type);
const char *rd_smspec_get_var_type_name(rd_smspec_var_type var_type);
rd_smspec_var_type rd_smspec_identify_var_type(const char *var);
rd_smspec_type *rd_smspec_alloc_empty(bool write_mode,
const char *key_join_string);

rd_smspec_type *rd_smspec_alloc_restart_writer(
const char *key_join_string, const char *restart_case, int restart_step,
time_t sim_start, bool time_in_days, int nx, int ny, int nz);
Expand All @@ -98,53 +71,13 @@ int rd_smspec_get_date_year_index(const rd_smspec_type *smspec);

int rd_smspec_get_well_var_params_index(const rd_smspec_type *rd_smspec,
const char *well, const char *var);
bool rd_smspec_has_well_var(const rd_smspec_type *rd_smspec, const char *well,
const char *var);

int rd_smspec_get_group_var_params_index(const rd_smspec_type *rd_smspec,
const char *group, const char *var);
bool rd_smspec_has_group_var(const rd_smspec_type *rd_smspec, const char *group,
const char *var);

int rd_smspec_get_field_var_params_index(const rd_smspec_type *rd_smspec,
const char *var);
bool rd_smspec_has_field_var(const rd_smspec_type *rd_smspec, const char *var);

int rd_smspec_get_region_var_params_index(const rd_smspec_type *rd_smspec,
const char *region_var,
int region_nr);
bool rd_smspec_has_region_var(const rd_smspec_type *rd_smspec,
const char *region_var, int region_nr);

int rd_smspec_get_misc_var_params_index(const rd_smspec_type *rd_smspec,
const char *var);
bool rd_smspec_has_misc_var(const rd_smspec_type *rd_smspec, const char *var);

int rd_smspec_get_block_var_params_index(const rd_smspec_type *rd_smspec,
const char *block_var, int block_nr);
bool rd_smspec_has_block_var(const rd_smspec_type *rd_smspec,
const char *block_var, int block_nr);

int rd_smspec_get_block_var_params_index_ijk(const rd_smspec_type *rd_smspec,
const char *block_var, int i,
int j, int k);
bool rd_smspec_has_block_var_ijk(const rd_smspec_type *rd_smspec,
const char *block_var, int i, int j, int k);

int rd_smspec_get_well_completion_var_params_index(
const rd_smspec_type *rd_smspec, const char *well, const char *var,
int cell_nr);
bool rd_smspec_has_well_completion_var(const rd_smspec_type *rd_smspec,
const char *well, const char *var,
int cell_nr);

int rd_smspec_get_general_var_params_index(const rd_smspec_type *rd_smspec,
const char *lookup_kw);
bool rd_smspec_has_general_var(const rd_smspec_type *rd_smspec,
const char *lookup_kw);
const char *rd_smspec_get_general_var_unit(const rd_smspec_type *rd_smspec,
const char *lookup_kw);

void rd_smspec_select_matching_general_var_list(const rd_smspec_type *smspec,
const char *pattern,
stringlist_type *keys);
Expand All @@ -161,22 +94,13 @@ stringlist_type *rd_smspec_alloc_well_list(const rd_smspec_type *smspec,
const char *pattern);
stringlist_type *rd_smspec_alloc_group_list(const rd_smspec_type *smspec,
const char *pattern);
stringlist_type *rd_smspec_alloc_well_var_list(const rd_smspec_type *smspec);
const char *rd_smspec_get_simulation_path(const rd_smspec_type *rd_smspec);
int rd_smspec_get_first_step(const rd_smspec_type *rd_smspec);
int rd_smspec_get_restart_step(const rd_smspec_type *rd_smspec);
const char *rd_smspec_get_restart_case(const rd_smspec_type *rd_smspec);
const char *rd_smspec_get_join_string(const rd_smspec_type *smspec);

const int *rd_smspec_get_grid_dims(const rd_smspec_type *smspec);
int rd_smspec_get_params_size(const rd_smspec_type *smspec);
int rd_smspec_num_nodes(const rd_smspec_type *smspec);

char *rd_smspec_alloc_well_key(const rd_smspec_type *smspec,
const char *keyword, const char *wgname);
bool rd_smspec_equal(const rd_smspec_type *self, const rd_smspec_type *other);

// void rd_smspec_sort( rd_smspec_type * smspec );
ert_rd_unit_enum rd_smspec_get_unit_system(const rd_smspec_type *smspec);

#ifdef __cplusplus
Expand Down
Loading