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 more unused c code #1006

Merged
merged 5 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ add_library(
resdata/rd_rsthead.cpp
resdata/rd_sum_tstep.cpp
resdata/rd_rst_file.cpp
resdata/rd_init_file.cpp
resdata/rd_grid_cache.cpp
resdata/smspec_node.cpp
resdata/rd_kw_grdecl.cpp
Expand All @@ -86,8 +85,6 @@ add_library(
resdata/rd_file.cpp
resdata/rd_region.cpp
resdata/rd_subsidence.cpp
resdata/rd_grid_dims.cpp
resdata/grid_dims.cpp
resdata/nnc_info.cpp
resdata/rd_grav_common.cpp
resdata/nnc_vector.cpp
Expand Down Expand Up @@ -271,7 +268,6 @@ foreach(
rd_sum_data_intermediate_test
rd_grid_cell_contains
rd_unsmry_loader_test
rd_init_file
rd_kw_space_pad
rd_kw_cmp_string
rd_kw_equal
Expand Down Expand Up @@ -374,7 +370,6 @@ foreach(
rd_grid_cell_contains_wellpath
rd_region2region
rd_grid_volume
rd_grid_dims
rd_nnc_test
rd_lgr_test
rd_layer_equinor
Expand Down Expand Up @@ -509,21 +504,6 @@ add_test(
# ${EXECUTABLE_OUTPUT_PATH}/rd_grid_volume
# ${_resdatapath}/Heidrun/Summary/FF12_2013B3_CLEAN_RS)

add_test(NAME rd_grid_dims0 COMMAND rd_grid_dims)
add_test(NAME rd_grid_dims1
COMMAND rd_grid_dims ${_resdatapath}/Gurbat/ECLIPSE.EGRID
${_resdatapath}/Gurbat/ECLIPSE.INIT)
add_test(NAME rd_grid_dims2
COMMAND rd_grid_dims ${_resdatapath}/Gurbat/ECLIPSE.GRID
${_resdatapath}/Gurbat/ECLIPSE.INIT)
add_test(NAME rd_grid_dims3 COMMAND rd_grid_dims
${_resdatapath}/Gurbat/ECLIPSE.EGRID)
add_test(NAME rd_grid_dims4 COMMAND rd_grid_dims
${_resdatapath}/Gurbat/ECLIPSE.GRID)
add_test(NAME rd_grid_dims5
COMMAND rd_grid_dims
${_resdatapath}/AmalgLGRcase/TESTCASE_AMALG_LGR.EGRID)

add_test(NAME rd_nnc_test1 COMMAND rd_nnc_test
${_resdatapath}/Gurbat/ECLIPSE.EGRID)
add_test(NAME rd_nnc_test2
Expand Down
19 changes: 0 additions & 19 deletions lib/include/resdata/grid_dims.hpp

This file was deleted.

2 changes: 0 additions & 2 deletions lib/include/resdata/rd_grid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <resdata/rd_coarse_cell.hpp>
#include <resdata/rd_kw.hpp>
#include <resdata/grid_dims.hpp>
#include <resdata/nnc_info.hpp>

#ifdef __cplusplus
Expand Down Expand Up @@ -166,7 +165,6 @@ char *rd_grid_alloc_case_filename(const char *case_input);

void rd_grid_free(rd_grid_type *);
void rd_grid_free__(void *arg);
grid_dims_type rd_grid_iget_dims(const rd_grid_type *grid, int grid_nr);
void rd_grid_get_dims(const rd_grid_type *, int *, int *, int *, int *);
int rd_grid_get_nz(const rd_grid_type *grid);
int rd_grid_get_nx(const rd_grid_type *grid);
Expand Down
21 changes: 0 additions & 21 deletions lib/include/resdata/rd_grid_dims.hpp

This file was deleted.

23 changes: 0 additions & 23 deletions lib/include/resdata/rd_init_file.hpp

This file was deleted.

2 changes: 0 additions & 2 deletions lib/include/resdata/rd_kw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ bool rd_kw_fread_realloc(rd_kw_type *, fortio_type *);
void rd_kw_fread(rd_kw_type *, fortio_type *);
rd_kw_type *rd_kw_fread_alloc(fortio_type *);
rd_kw_type *rd_kw_alloc_actnum(const rd_kw_type *porv_kw, float porv_limit);
rd_kw_type *rd_kw_alloc_actnum_bitmask(const rd_kw_type *porv_kw,
float porv_limit, int actnum_bitmask);
void rd_kw_free_data(rd_kw_type *);
void rd_kw_fread_indexed_data(fortio_type *fortio, offset_type data_offset,
rd_data_type, int element_count,
Expand Down
34 changes: 0 additions & 34 deletions lib/include/resdata/rd_region.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@ typedef enum {

typedef struct rd_region_struct rd_region_type;

void rd_region_unlock(rd_region_type *region);
void rd_region_lock(rd_region_type *region);
void rd_region_reset(rd_region_type *rd_region);
rd_region_type *rd_region_alloc_copy(const rd_region_type *rd_region);
rd_region_type *rd_region_alloc(const rd_grid_type *rd_grid, bool preselect);
void rd_region_free(rd_region_type *region);
void rd_region_free__(void *__region);

const int_vector_type *rd_region_get_active_list(rd_region_type *region);
const int_vector_type *rd_region_get_global_list(rd_region_type *region);
Expand All @@ -57,7 +54,6 @@ void rd_region_select_true(rd_region_type *region, const rd_kw_type *rd_kw);
void rd_region_invert_selection(rd_region_type *region);
void rd_region_select_all(rd_region_type *region);
void rd_region_deselect_all(rd_region_type *region);
void rd_region_deselect_true(rd_region_type *region, const rd_kw_type *rd_kw);
void rd_region_select_false(rd_region_type *region, const rd_kw_type *rd_kw);

void rd_region_select_in_interval(rd_region_type *region,
Expand Down Expand Up @@ -109,14 +105,6 @@ void rd_region_select_large_cells(rd_region_type *rd_region,
void rd_region_deselect_large_cells(rd_region_type *rd_region,
double volum_limit);

void rd_region_select_global_index(rd_region_type *rd_region, int global_index);
void rd_region_deselect_global_index(rd_region_type *rd_region,
int global_index);

void rd_region_select_active_index(rd_region_type *rd_region, int active_index);
void rd_region_deselect_active_index(rd_region_type *rd_region,
int active_index);

void rd_region_intersection(rd_region_type *region,
const rd_region_type *new_region);
void rd_region_union(rd_region_type *region, const rd_region_type *new_region);
Expand All @@ -142,15 +130,6 @@ void rd_region_cmp_select_more(rd_region_type *rd_region, const rd_kw_type *kw1,
void rd_region_cmp_deselect_more(rd_region_type *rd_region,
const rd_kw_type *kw1, const rd_kw_type *kw2);

void rd_region_select_in_cylinder(rd_region_type *region, double x0, double y0,
double R);
void rd_region_deselect_in_cylinder(rd_region_type *region, double x0,
double y0, double R);
void rd_region_select_in_zcylinder(rd_region_type *region, double x0, double y0,
double R, double z1, double z2);
void rd_region_deselect_in_zcylinder(rd_region_type *region, double x0,
double y0, double R, double z1, double z2);

void rd_region_select_above_plane(rd_region_type *region, const double n[3],
const double p[3]);
void rd_region_select_below_plane(rd_region_type *region, const double n[3],
Expand All @@ -172,10 +151,6 @@ void rd_region_deselect_outside_polygon(rd_region_type *region,
void rd_region_select_from_layer(rd_region_type *region,
const layer_type *layer, int k,
int layer_value);
void rd_region_deselect_from_layer(rd_region_type *region,
const layer_type *layer, int k,
int layer_value);
void rd_region_deselect_false(rd_region_type *region, const rd_kw_type *rd_kw);

void rd_region_set_kw_int(rd_region_type *rd_region, rd_kw_type *rd_kw,
int value, bool force_active);
Expand All @@ -185,8 +160,6 @@ void rd_region_set_kw_double(rd_region_type *rd_region, rd_kw_type *rd_kw,
double value, bool force_active);
void rd_region_kw_copy(rd_region_type *rd_region, rd_kw_type *rd_kw,
const rd_kw_type *src_kw, bool force_active);
int rd_region_get_kw_size(rd_region_type *rd_region, const rd_kw_type *rd_kw,
bool force_active);

void rd_region_kw_iadd(rd_region_type *rd_region, rd_kw_type *rd_kw,
const rd_kw_type *delta_kw, bool force_active);
Expand Down Expand Up @@ -220,19 +193,12 @@ const int_vector_type *rd_region_get_kw_index_list(rd_region_type *rd_region,
void rd_region_set_name(rd_region_type *region, const char *name);
const char *rd_region_get_name(const rd_region_type *region);

int rd_region_get_active_size_cpp(rd_region_type *region);
int rd_region_get_global_size_cpp(rd_region_type *region);
const int *rd_region_get_active_list_cpp(rd_region_type *region);
const int *rd_region_get_global_list_cpp(rd_region_type *region);

double rd_region_sum_kw_double(rd_region_type *rd_region,
const rd_kw_type *rd_kw, bool force_active);
int rd_region_sum_kw_int(rd_region_type *rd_region, const rd_kw_type *rd_kw,
bool force_active);
float rd_region_sum_kw_float(rd_region_type *rd_region, const rd_kw_type *rd_kw,
bool force_active);
int rd_region_sum_kw_bool(rd_region_type *rd_region, const rd_kw_type *rd_kw,
bool force_active);

UTIL_IS_INSTANCE_HEADER(rd_region);
UTIL_SAFE_CAST_HEADER(rd_region);
Expand Down
14 changes: 0 additions & 14 deletions lib/include/resdata/rd_sum_tstep.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ extern "C" {

typedef struct rd_sum_tstep_struct rd_sum_tstep_type;

rd_sum_tstep_type *
rd_sum_tstep_alloc_remap_copy(const rd_sum_tstep_type *src,
const rd_smspec_type *new_smspec,
float default_value, const int *params_map);
rd_sum_tstep_type *rd_sum_tstep_alloc_copy(const rd_sum_tstep_type *src);
void rd_sum_tstep_free(rd_sum_tstep_type *ministep);
void rd_sum_tstep_free__(void *__ministep);
rd_sum_tstep_type *rd_sum_tstep_alloc_from_file(int report_step,
Expand Down Expand Up @@ -48,21 +43,12 @@ void rd_sum_tstep_fwrite(const rd_sum_tstep_type *ministep,
fortio_type *fortio);
void rd_sum_tstep_iset(rd_sum_tstep_type *tstep, int index, float value);

/// scales with value; equivalent to iset( iget() * scalar)
void rd_sum_tstep_iscale(rd_sum_tstep_type *tstep, int index, float scalar);

/// adds addend to tstep[index]; equivalent to iset( iget() + addend)
void rd_sum_tstep_ishift(rd_sum_tstep_type *tstep, int index, float addend);

void rd_sum_tstep_set_from_key(rd_sum_tstep_type *tstep, const char *gen_key,
float value);
double rd_sum_tstep_get_from_key(const rd_sum_tstep_type *tstep,
const char *gen_key);
bool rd_sum_tstep_has_key(const rd_sum_tstep_type *tstep, const char *gen_key);

bool rd_sum_tstep_sim_time_equal(const rd_sum_tstep_type *tstep1,
const rd_sum_tstep_type *tstep2);

UTIL_SAFE_CAST_HEADER(rd_sum_tstep);
UTIL_SAFE_CAST_HEADER_CONST(rd_sum_tstep);

Expand Down
25 changes: 0 additions & 25 deletions lib/resdata/grid_dims.cpp

This file was deleted.

18 changes: 0 additions & 18 deletions lib/resdata/rd_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <resdata/rd_endian_flip.hpp>
#include <resdata/rd_coarse_cell.hpp>
#include <resdata/rd_grid.hpp>
#include <resdata/grid_dims.hpp>
#include <resdata/nnc_info.hpp>

/**
Expand Down Expand Up @@ -4695,23 +4694,6 @@ int rd_grid_get_ny(const rd_grid_type *grid) { return grid->ny; }

int rd_grid_get_nactive(const rd_grid_type *grid) { return grid->total_active; }

grid_dims_type rd_grid_iget_dims(const rd_grid_type *grid, int grid_nr) {
grid_dims_type dims;
const rd_grid_type *lgr;

if (grid_nr == 0)
lgr = grid;
else
lgr = rd_grid_iget_lgr(grid, grid_nr - 1);

dims.nx = lgr->nx;
dims.ny = lgr->ny;
dims.nz = lgr->nz;
dims.nactive = lgr->total_active;

return dims;
}

int rd_grid_get_nactive_fracture(const rd_grid_type *grid) {
return grid->total_active_fracture;
}
Expand Down
Loading