diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index f5d7a55d5..056e9a166 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -58,6 +58,7 @@ list (APPEND MAIN_SOURCE_FILES opm/grid/cpgpreprocess/facetopology.c opm/grid/cpgpreprocess/geometry.c opm/grid/cpgpreprocess/preprocess.c + opm/grid/cpgpreprocess/make_edge_conformal.cpp opm/grid/cpgpreprocess/uniquepoints.c opm/grid/UnstructuredGrid.c opm/grid/grid_equal.cpp @@ -250,6 +251,7 @@ list (APPEND PUBLIC_HEADER_FILES opm/grid/cpgpreprocess/facetopology.h opm/grid/cpgpreprocess/geometry.h opm/grid/cpgpreprocess/preprocess.h + opm/grid/cpgpreprocess/make_edge_conformal.hpp opm/grid/cpgpreprocess/uniquepoints.h opm/grid/transmissibility/trans_tpfa.h opm/grid/transmissibility/TransTpfa.hpp diff --git a/opm/grid/cornerpoint_grid.c b/opm/grid/cornerpoint_grid.c index c8bc322cc..efe434169 100644 --- a/opm/grid/cornerpoint_grid.c +++ b/opm/grid/cornerpoint_grid.c @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -175,8 +176,9 @@ create_grid_cornerpoint(const struct grdecl *in, double tol, bool edge_conformal ok = process_grdecl(in, tol, NULL, &pg, false, edge_conformal); if(edge_conformal){ - //add_cells(&pg); - //make edge conformal + // if add cells is done one could skip som of the code later + add_cells(&pg); + make_edge_conformal(&pg); } if (!ok) diff --git a/opm/grid/cpgpreprocess/make_edge_conformal.cpp b/opm/grid/cpgpreprocess/make_edge_conformal.cpp index 78954c7c3..d4f7cd8c4 100644 --- a/opm/grid/cpgpreprocess/make_edge_conformal.cpp +++ b/opm/grid/cpgpreprocess/make_edge_conformal.cpp @@ -1,3 +1,4 @@ +#include "config.h" #include "preprocess.h" #include "make_edge_conformal.hpp" #include @@ -405,7 +406,7 @@ void fix_edges_at_top(const struct processed_grid& grid, } }//end cell -extern "C" void make_edge_conformal(struct processed_grid* grid){ +void make_edge_conformal(struct processed_grid* grid){ std::cout << "Fixing edge grid to be edge conformal" << std::endl; std::vector nodes; std::vector nodePos; diff --git a/opm/grid/cpgpreprocess/make_edge_conformal.hpp b/opm/grid/cpgpreprocess/make_edge_conformal.hpp index 857fbee6f..0acf124f2 100644 --- a/opm/grid/cpgpreprocess/make_edge_conformal.hpp +++ b/opm/grid/cpgpreprocess/make_edge_conformal.hpp @@ -2,7 +2,6 @@ #define OPENRS_MAKE_EDGE_CONFORMAL_HEADER #include "preprocess.h" -extern "C" { - void make_edge_conformal(struct processed_grid* grdecl); -} +void make_edge_conformal(struct processed_grid* grdecl); + #endif diff --git a/opm/grid/cpgpreprocess/preprocess.c b/opm/grid/cpgpreprocess/preprocess.c index b41a0fb59..c4efe3bac 100644 --- a/opm/grid/cpgpreprocess/preprocess.c +++ b/opm/grid/cpgpreprocess/preprocess.c @@ -1104,7 +1104,7 @@ reverse_face_nodes(struct processed_grid *out) } /* ---------------------------------------------------------------------- */ -static void +void add_cells(struct processed_grid *grid) /* ---------------------------------------------------------------------- */ { diff --git a/opm/grid/cpgpreprocess/preprocess.h b/opm/grid/cpgpreprocess/preprocess.h index a3b034580..e000bb4a1 100644 --- a/opm/grid/cpgpreprocess/preprocess.h +++ b/opm/grid/cpgpreprocess/preprocess.h @@ -156,7 +156,7 @@ extern "C" { * call to function process_grdecl(). */ void free_processed_grid(struct processed_grid *g, bool edge_conformal); - + void add_cells(struct processed_grid *grid); #ifdef __cplusplus } #endif