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 ecl conditionals #401

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 16 additions & 31 deletions CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,15 @@ list (APPEND MAIN_SOURCE_FILES
opm/grid/cpgpreprocess/uniquepoints.c
opm/grid/UnstructuredGrid.c
opm/grid/grid_equal.cpp
opm/grid/transmissibility/trans_tpfa.c
opm/grid/utility/compressedToCartesian.cpp
opm/grid/utility/cartesianToCompressed.cpp
opm/grid/utility/extractPvtTableIndex.cpp
opm/grid/utility/StopWatch.cpp
opm/grid/utility/VelocityInterpolation.cpp
opm/grid/utility/WachspressCoord.cpp
)

if (opm-common_FOUND)
list(APPEND MAIN_SOURCE_FILES
opm/grid/utility/VelocityInterpolation.cpp
opm/grid/transmissibility/trans_tpfa.c)
endif()

if(HAVE_ECL_INPUT)
list(APPEND MAIN_SOURCE_FILES opm/grid/utility/extractPvtTableIndex.cpp)
endif()

# originally generated with the command:
# find tests/not-unit/ -name \*.cpp -o \*.cc
list (APPEND ATTIC_FILES
Expand All @@ -85,11 +78,13 @@ list (APPEND ATTIC_FILES
list (APPEND TEST_SOURCE_FILES
tests/test_cartgrid.cpp
tests/test_column_extract.cpp
tests/test_compressedpropertyaccess.cpp
tests/cpgrid/distribution_test.cpp
tests/cpgrid/entityrep_test.cpp
tests/cpgrid/entity_test.cpp
tests/cpgrid/facetag_test.cpp
tests/cpgrid/geometry_test.cpp
tests/cpgrid/grid_nnc.cpp
tests/cpgrid/orientedentitytable_test.cpp
tests/cpgrid/partition_iterator_test.cpp
tests/cpgrid/zoltan_test.cpp
Expand All @@ -98,20 +93,13 @@ list (APPEND TEST_SOURCE_FILES
tests/test_minpvprocessor.cpp
# tests/grid_test.cc
tests/p2pcommunicator_test.cc
tests/test_regionmapping.cpp
tests/test_quadratures.cpp
tests/test_repairzcorn.cpp
tests/test_sparsetable.cpp
tests/test_quadratures.cpp
tests/test_ug.cpp
tests/test_compressed_cartesian_mapping.cpp
)

if(HAVE_ECL_INPUT)
list(APPEND TEST_SOURCE_FILES
tests/test_regionmapping.cpp
tests/test_ug.cpp
tests/test_compressedpropertyaccess.cpp
tests/cpgrid/grid_nnc.cpp
)
endif()
)

# originally generated with the command:
# find tests -name '*.xml' -a ! -wholename '*/not-unit/*' -printf '\t%p\n' | sort
Expand All @@ -126,19 +114,17 @@ list (APPEND TEST_DATA_FILES
# originally generated with the command:
# find tutorials examples -name '*.c*' -printf '\t%p\n' | sort
list (APPEND EXAMPLE_SOURCE_FILES
examples/finitevolume/finitevolume.cc
examples/mirror_grid.cpp
)
examples/finitevolume/finitevolume.cc
examples/grdecl2vtu.cpp
examples/mirror_grid.cpp
)

# programs listed here will not only be compiled, but also marked for
# installation
list (APPEND PROGRAM_SOURCE_FILES
examples/mirror_grid.cpp
)
if(HAVE_ECL_INPUT)
list(APPEND EXAMPLE_SOURCE_FILES examples/grdecl2vtu.cpp)
list(APPEND PROGRAM_SOURCE_FILES examples/grdecl2vtu.cpp)
endif()
examples/mirror_grid.cpp
examples/grdecl2vtu.cpp
)

# originally generated with the command:
# find dune -name '*.h*' -a ! -name '*-pch.hpp' -printf '\t%p\n' | sort
Expand Down Expand Up @@ -217,7 +203,6 @@ list (APPEND PUBLIC_HEADER_FILES
opm/grid/utility/StopWatch.hpp
opm/grid/utility/VelocityInterpolation.hpp
opm/grid/utility/WachspressCoord.hpp
opm/grid/utility/ErrorMacros.hpp
opm/grid/utility/OpmParserIncludes.hpp
opm/grid/utility/platform_dependent/disable_warnings.h
opm/grid/utility/platform_dependent/reenable_warnings.h
Expand Down
2 changes: 0 additions & 2 deletions opm-grid-prereqs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ set (opm-grid_CONFIG_VAR
HAVE_DUNE_ISTL
HAVE_MPI
HAVE_ZOLTAN
HAVE_OPM_COMMON
HAVE_ECL_INPUT
)

# dependencies
Expand Down
2 changes: 1 addition & 1 deletion opm/grid/CellQuadrature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define OPM_CELLQUADRATURE_HEADER_INCLUDED

#include <opm/grid/UnstructuredGrid.h>
#include <opm/grid/utility/ErrorMacros.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <algorithm>
#include <cmath>

Expand Down
4 changes: 1 addition & 3 deletions opm/grid/CpGrid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <map>
#include <array>
#include <unordered_set>
#include <opm/grid/utility/ErrorMacros.hpp>
#include <opm/common/ErrorMacros.hpp>

// Warning suppression for Dune includes.
#include <opm/grid/utility/platform_dependent/disable_warnings.h>
Expand Down Expand Up @@ -257,7 +257,6 @@ namespace Dune
void writeSintefLegacyFormat(const std::string& grid_prefix) const;


#if HAVE_ECL_INPUT
/// Read the Eclipse grid format ('grdecl').
/// \param ecl_grid the high-level object from opm-parser which represents the simulation's grid
/// \param periodic_extension if true, the grid will be (possibly) refined, so that
Expand All @@ -269,7 +268,6 @@ namespace Dune
void processEclipseFormat(const Opm::EclipseGrid& ecl_grid, bool periodic_extension, bool turn_normals = false, bool clip_z = false,
const std::vector<double>& poreVolume = std::vector<double>(),
const Opm::NNC& = Opm::NNC());
#endif

/// Read the Eclipse grid format ('grdecl').
/// \param input_data the data in grdecl format, declared in preprocess.h.
Expand Down
2 changes: 1 addition & 1 deletion opm/grid/FaceQuadrature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef OPM_FACEQUADRATURE_HEADER_INCLUDED
#define OPM_FACEQUADRATURE_HEADER_INCLUDED

#include <opm/grid/utility/ErrorMacros.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <opm/grid/UnstructuredGrid.h>
#include <cmath>

Expand Down
2 changes: 0 additions & 2 deletions opm/grid/GridHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ FaceCellTraits<UnstructuredGrid>::Type faceCells(const UnstructuredGrid& grid)
}


#if HAVE_ECL_INPUT
Opm::EclipseGrid createEclipseGrid(const UnstructuredGrid& grid, const Opm::EclipseGrid& inputGrid ) {
const int * dims = UgGridHelpers::cartDims( grid );

Expand All @@ -345,7 +344,6 @@ Opm::EclipseGrid createEclipseGrid(const UnstructuredGrid& grid, const Opm::Ecli
throw std::invalid_argument("Size mismatch - dimensions of inputGrid argument and current UnstructuredGrid instance disagree");
}
}
#endif

}
}
2 changes: 0 additions & 2 deletions opm/grid/GridHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,9 @@ struct CellVolumeIteratorTraits<UnstructuredGrid>
correctly represented in the EclipseGrid created by this
method.
*/
#if HAVE_ECL_INPUT
/// \brief Construct an EclipseGrid instance based on the inputGrid, with modifications to
/// zcorn and actnum from the dune UnstructuredGrid.
Opm::EclipseGrid createEclipseGrid(const UnstructuredGrid& grid, const Opm::EclipseGrid& inputGrid );
#endif

/// \brief Get an iterator over the cell volumes of a grid positioned at the first cell.
const double* beginCellVolumes(const UnstructuredGrid& grid);
Expand Down
7 changes: 1 addition & 6 deletions opm/grid/GridManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <opm/grid/cart_grid.h>
#include <opm/grid/cornerpoint_grid.h>
#include <opm/grid/MinpvProcessor.hpp>
#include <opm/grid/utility/ErrorMacros.hpp>
#include <opm/common/ErrorMacros.hpp>

#include <opm/grid/utility/OpmParserIncludes.hpp>

Expand All @@ -36,7 +36,6 @@
namespace Opm
{

#if HAVE_ECL_INPUT
/// Construct a 3d corner-point grid from a deck.
GridManager::GridManager(const Opm::EclipseGrid& inputGrid)
: ug_(0)
Expand All @@ -51,7 +50,6 @@ namespace Opm
{
initFromEclipseGrid(inputGrid, poreVolumes);
}
#endif


/// Construct a 2d cartesian grid with cells of unit size.
Expand Down Expand Up @@ -127,7 +125,6 @@ namespace Opm



#if HAVE_ECL_INPUT
// Construct corner-point grid from EclipseGrid.
void GridManager::initFromEclipseGrid(const Opm::EclipseGrid& inputGrid,
const std::vector<double>& poreVolumes)
Expand Down Expand Up @@ -173,8 +170,6 @@ namespace Opm

}

#endif




Expand Down
4 changes: 0 additions & 4 deletions opm/grid/GridManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ namespace Opm
{
public:

#if HAVE_ECL_INPUT
/// Construct a grid from an EclipseState::EclipseGrid instance.
explicit GridManager(const Opm::EclipseGrid& inputGrid);

Expand All @@ -52,7 +51,6 @@ namespace Opm
/// \input[in] poreVolumes one element per logical cartesian grid element
GridManager(const Opm::EclipseGrid& inputGrid,
const std::vector<double>& poreVolumes);
#endif

/// Construct a 2d cartesian grid with cells of unit size.
GridManager(int nx, int ny);
Expand Down Expand Up @@ -85,11 +83,9 @@ namespace Opm
GridManager(const GridManager& other);
GridManager& operator=(const GridManager& other);

#if HAVE_ECL_INPUT
// Construct corner-point grid from EclipseGrid.
void initFromEclipseGrid(const Opm::EclipseGrid& inputGrid,
const std::vector<double>& poreVolumes);
#endif

// The managed UnstructuredGrid.
UnstructuredGrid* ug_;
Expand Down
2 changes: 1 addition & 1 deletion opm/grid/MinpvProcessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define OPM_MINPVPROCESSOR_HEADER_INCLUDED


#include <opm/grid/utility/ErrorMacros.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <opm/grid/utility/OpmParserIncludes.hpp>

#include <array>
Expand Down
2 changes: 1 addition & 1 deletion opm/grid/common/GeometryHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#include <cmath>

#include <opm/grid/utility/ErrorMacros.hpp>
#include <opm/common/ErrorMacros.hpp>
#include "Volumes.hpp"

namespace Dune
Expand Down
6 changes: 0 additions & 6 deletions opm/grid/common/WellConnections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ void WellConnections::init(const std::vector<OpmWellType>& wells,
const std::array<int, 3>& cartesianSize,
const std::vector<int>& cartesian_to_compressed)
{
#if HAVE_ECL_INPUT
well_indices_.resize(wells.size());

// We assume that we know all the wells.
Expand All @@ -64,7 +63,6 @@ void WellConnections::init(const std::vector<OpmWellType>& wells,
}
++index;
}
#endif
}

std::vector<std::vector<int> >
Expand All @@ -76,7 +74,6 @@ postProcessPartitioningForWells(std::vector<int>& parts,
// Contains for each process the indices of the wells assigned to it.
std::vector<std::vector<int> > well_indices_on_proc(no_procs);

#if HAVE_ECL_INPUT
if( ! well_connections.size() )
{
// No wells to be processed
Expand Down Expand Up @@ -127,7 +124,6 @@ postProcessPartitioningForWells(std::vector<int>& parts,
well_indices_on_proc[owner].push_back(well_index);
++well_index;
}
#endif

return well_indices_on_proc;

Expand All @@ -143,7 +139,6 @@ computeDefunctWellNames(const std::vector<std::vector<int> >& wells_on_proc,
// We need to use well names as only they are consistent.
std::unordered_set<std::string> defunct_well_names;

#if HAVE_ECL_INPUT
std::vector<int> my_well_indices;
const int well_information_tag = 267553;

Expand Down Expand Up @@ -190,7 +185,6 @@ computeDefunctWellNames(const std::vector<std::vector<int> >& wells_on_proc,
defunct_well_names.insert(wells[defunct-defunct_wells.begin()].name());
}
}
#endif

return defunct_well_names;
}
Expand Down
2 changes: 0 additions & 2 deletions opm/grid/cpgrid/CpGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ CpGrid::scatterGrid(EdgeWeightMethod method, const std::vector<cpgrid::OpmWellTy
}


#if HAVE_ECL_INPUT
void CpGrid::processEclipseFormat(const Opm::EclipseGrid& ecl_grid,
bool periodic_extension,
bool turn_normals, bool clip_z,
Expand All @@ -279,7 +278,6 @@ CpGrid::scatterGrid(EdgeWeightMethod method, const std::vector<cpgrid::OpmWellTy
turn_normals, clip_z,
poreVolume, nncs);
}
#endif

void CpGrid::processEclipseFormat(const grdecl& input_data, double z_tolerance,
bool remove_ij_boundary, bool turn_normals)
Expand Down
2 changes: 0 additions & 2 deletions opm/grid/cpgrid/CpGridData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ class CpGridData
/// side. That is, i- faces will match i+ faces etc.
void readEclipseFormat(const std::string& filename, bool periodic_extension, bool turn_normals = false);

#if HAVE_ECL_INPUT
/// Read the Eclipse grid format ('grdecl').
/// \param deck the parsed deck from opm-parser (which is a low-level object)
/// \param periodic_extension if true, the grid will be (possibly) refined, so that
Expand All @@ -193,7 +192,6 @@ class CpGridData
/// \param poreVolume pore volumes for use in MINPV processing, if asked for in deck
void processEclipseFormat(const Opm::EclipseGrid& ecl_grid, bool periodic_extension, bool turn_normals = false, bool clip_z = false,
const std::vector<double>& poreVolume = std::vector<double>(), const Opm::NNC& nncs = Opm::NNC());
#endif

/// Read the Eclipse grid format ('grdecl').
/// \param input_data the data in grdecl format, declared in preprocess.h.
Expand Down
2 changes: 1 addition & 1 deletion opm/grid/cpgrid/EntityRep.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace Dune


//#include <opm/core/utility/SparseTable.hpp>
#include <opm/grid/utility/ErrorMacros.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <climits>
//#include <boost/algorithm/minmax_element.hpp>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion opm/grid/cpgrid/Geometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include <opm/grid/cpgrid/EntityRep.hpp>
#include <opm/grid/utility/platform_dependent/reenable_warnings.h>

#include <opm/grid/utility/ErrorMacros.hpp>
#include <opm/common/ErrorMacros.hpp>

namespace Dune
{
Expand Down
2 changes: 0 additions & 2 deletions opm/grid/cpgrid/GridHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ namespace Opm
namespace UgGridHelpers
{

#if HAVE_ECL_INPUT
EclipseGrid createEclipseGrid(const Dune::CpGrid& grid, const EclipseGrid& inputGrid)
{
const int * dims = cartDims( grid );
Expand All @@ -52,7 +51,6 @@ EclipseGrid createEclipseGrid(const Dune::CpGrid& grid, const EclipseGrid& input
throw std::invalid_argument("Size mismatch - dimensions of inputGrid argument and current Dune CpGrid instance disagree");
}
}
#endif

int numCells(const Dune::CpGrid& grid)
{
Expand Down
2 changes: 0 additions & 2 deletions opm/grid/cpgrid/GridHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,9 @@ const int* cartDims(const Dune::CpGrid& grid);
/// in the underlying structured grid.
const int* globalCell(const Dune::CpGrid&);

#if HAVE_ECL_INPUT
/// Construct an EclipseGrid instance based on the inputGrid, with modifications to
/// zcorn and actum from the dune CPGrid
EclipseGrid createEclipseGrid(const Dune::CpGrid& grid, const EclipseGrid& inputGrid);
#endif

CellCentroidTraits<Dune::CpGrid>::IteratorType
beginCellCentroids(const Dune::CpGrid& grid);
Expand Down