From 81b58a0acfb9eba662308ebcd6b0156d042da953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 19 Dec 2011 12:36:56 +0100 Subject: [PATCH] Now library contents build. Headers and tests not done yet. --- Makefile.am | 12 +++++++ opm/core/eclipse/CornerpointChopper.hpp | 4 +-- opm/core/eclipse/EclipseGridInspector.cpp | 32 +++++++++---------- opm/core/eclipse/EclipseGridInspector.hpp | 10 +++--- opm/core/eclipse/EclipseGridParser.cpp | 10 +++--- opm/core/eclipse/EclipseGridParser.hpp | 6 ++-- opm/core/eclipse/EclipseGridParserHelpers.hpp | 4 +-- opm/core/eclipse/SpecialEclipseFields.hpp | 6 ++-- opm/core/utility/parameters/Makefile.am | 2 +- opm/core/utility/parameters/Parameter.cpp | 2 +- opm/core/utility/parameters/Parameter.hpp | 4 +-- .../utility/parameters/ParameterGroup.cpp | 10 +++--- .../utility/parameters/ParameterGroup.hpp | 6 ++-- .../parameters/ParameterGroup_impl.hpp | 8 ++--- .../utility/parameters/ParameterTools.cpp | 4 +-- opm/core/utility/parameters/ParameterXML.cpp | 8 ++--- opm/core/utility/parameters/ParameterXML.hpp | 2 +- 17 files changed, 70 insertions(+), 60 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8722e73e..9a50d23e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,6 +7,17 @@ SUBDIRS = . tests examples lib_LTLIBRARIES = libopmcore.la libopmcore_la_SOURCES = \ +opm/core/eclipse/EclipseGridInspector.cpp \ +opm/core/eclipse/EclipseGridParser.cpp \ +opm/core/utility/MonotCubicInterpolator.cpp \ +opm/core/utility/parameters/Parameter.cpp \ +opm/core/utility/parameters/ParameterGroup.cpp \ +opm/core/utility/parameters/ParameterTools.cpp \ +opm/core/utility/parameters/ParameterXML.cpp \ +opm/core/utility/parameters/tinyxml/tinystr.cpp \ +opm/core/utility/parameters/tinyxml/tinyxml.cpp \ +opm/core/utility/parameters/tinyxml/tinyxmlerror.cpp \ +opm/core/utility/parameters/tinyxml/tinyxmlparser.cpp \ opm/core/utility/cart_grid.c \ opm/core/utility/cpgpreprocess/geometry.c \ opm/core/utility/cpgpreprocess/preprocess.c \ @@ -15,6 +26,7 @@ opm/core/utility/cpgpreprocess/cgridinterface.c \ opm/core/utility/cpgpreprocess/sparsetable.c \ opm/core/utility/cpgpreprocess/facetopology.c \ opm/core/utility/cpgpreprocess/uniquepoints.c \ +opm/core/utility/StopWatch.cpp \ opm/core/linalg/sparse_sys.c \ opm/core/pressure/cfsh.c \ opm/core/pressure/flow_bc.c \ diff --git a/opm/core/eclipse/CornerpointChopper.hpp b/opm/core/eclipse/CornerpointChopper.hpp index 62a6a05c..7fefc506 100644 --- a/opm/core/eclipse/CornerpointChopper.hpp +++ b/opm/core/eclipse/CornerpointChopper.hpp @@ -20,8 +20,8 @@ #ifndef OPM_CORNERPOINTCHOPPER_HEADER_INCLUDED #define OPM_CORNERPOINTCHOPPER_HEADER_INCLUDED -#include -#include +#include +#include #include #include #include diff --git a/opm/core/eclipse/EclipseGridInspector.cpp b/opm/core/eclipse/EclipseGridInspector.cpp index b62e4198..ad7473bc 100644 --- a/opm/core/eclipse/EclipseGridInspector.cpp +++ b/opm/core/eclipse/EclipseGridInspector.cpp @@ -42,9 +42,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include namespace Dune { @@ -100,7 +100,7 @@ std::pair EclipseGridInspector::cellDips(int i, int j, int k) con } // Pick ZCORN-value for all 8 corners of the given cell - boost::array cellz = cellZvals(i, j, k); + std::tr1::array cellz = cellZvals(i, j, k); // Compute rise in positive x-direction for all four edges (and then find mean) // Current implementation is for regularly placed and vertical pillars! @@ -125,7 +125,7 @@ std::pair EclipseGridInspector::cellDips(int i, int j, int k) con // don't follow an overall dip for the model if it exists. int x_edges = 4; int y_edges = 4; - boost::array gridlimits = getGridLimits(); + std::tr1::array gridlimits = getGridLimits(); double zmin = gridlimits[4]; double zmax = gridlimits[5]; // LLL -> HLL @@ -169,11 +169,11 @@ std::pair EclipseGridInspector::cellDips(int i, int j, int k) con */ std::pair EclipseGridInspector::cellDips(int cell_idx) const { - boost::array idxs = cellIdxToLogicalCoords(cell_idx); + std::tr1::array idxs = cellIdxToLogicalCoords(cell_idx); return cellDips(idxs[0], idxs[1], idxs[2]); } -boost::array EclipseGridInspector::cellIdxToLogicalCoords(int cell_idx) const +std::tr1::array EclipseGridInspector::cellIdxToLogicalCoords(int cell_idx) const { int i,j,k; // Position of cell in cell hierarchy @@ -188,8 +188,8 @@ boost::array EclipseGridInspector::cellIdxToLogicalCoords(int cell_idx) j = (horIdx-i)/logical_gridsize_[0]+1; k = ((cell_idx+1)-logical_gridsize_[0]*(j-1)-1)/(logical_gridsize_[0]*logical_gridsize_[1])+1; - boost::array a = {{i-1, j-1, k-1}}; - return a; //boost::array {{i-1, j-1, k-1}}; + std::tr1::array a = {{i-1, j-1, k-1}}; + return a; //std::tr1::array {{i-1, j-1, k-1}}; } double EclipseGridInspector::cellVolumeVerticalPillars(int i, int j, int k) const @@ -242,7 +242,7 @@ double EclipseGridInspector::cellVolumeVerticalPillars(int i, int j, int k) cons double EclipseGridInspector::cellVolumeVerticalPillars(int cell_idx) const { - boost::array idxs = cellIdxToLogicalCoords(cell_idx); + std::tr1::array idxs = cellIdxToLogicalCoords(cell_idx); return cellVolumeVerticalPillars(idxs[0], idxs[1], idxs[2]); } @@ -257,7 +257,7 @@ void EclipseGridInspector::checkLogicalCoords(int i, int j, int k) const } -boost::array EclipseGridInspector::getGridLimits() const +std::tr1::array EclipseGridInspector::getGridLimits() const { if (! (parser_.hasField("COORD") && parser_.hasField("ZCORN") && parser_.hasField("SPECGRID")) ) { throw std::runtime_error("EclipseGridInspector: Grid does not have SPECGRID, COORD, and ZCORN, can't find dimensions."); @@ -293,7 +293,7 @@ boost::array EclipseGridInspector::getGridLimits() const ymin = coord[pillarindex * 6 + 4]; } - boost::array gridlimits = {{ xmin, xmax, ymin, ymax, + std::tr1::array gridlimits = {{ xmin, xmax, ymin, ymax, *min_element(zcorn.begin(), zcorn.end()), *max_element(zcorn.begin(), zcorn.end()) }}; return gridlimits; @@ -301,16 +301,16 @@ boost::array EclipseGridInspector::getGridLimits() const -boost::array EclipseGridInspector::gridSize() const +std::tr1::array EclipseGridInspector::gridSize() const { - boost::array retval = {{ logical_gridsize_[0], + std::tr1::array retval = {{ logical_gridsize_[0], logical_gridsize_[1], logical_gridsize_[2] }}; return retval; } -boost::array EclipseGridInspector::cellZvals(int i, int j, int k) const +std::tr1::array EclipseGridInspector::cellZvals(int i, int j, int k) const { // Get the zcorn field. const std::vector& z = parser_.getFloatingPointValue("ZCORN"); @@ -324,7 +324,7 @@ boost::array EclipseGridInspector::cellZvals(int i, int j, int k) con 2*logical_gridsize_[0], 4*logical_gridsize_[0]*logical_gridsize_[1] }; int ix = 2*(i*delta[0] + j*delta[1] + k*delta[2]); - boost::array cellz = {{ z[ix], z[ix + delta[0]], + std::tr1::array cellz = {{ z[ix], z[ix + delta[0]], z[ix + delta[1]], z[ix + delta[1] + delta[0]], z[ix + delta[2]], z[ix + delta[2] + delta[0]], z[ix + delta[2] + delta[1]], z[ix + delta[2] + delta[1] + delta[0]] }}; diff --git a/opm/core/eclipse/EclipseGridInspector.hpp b/opm/core/eclipse/EclipseGridInspector.hpp index c314d28e..c5689706 100644 --- a/opm/core/eclipse/EclipseGridInspector.hpp +++ b/opm/core/eclipse/EclipseGridInspector.hpp @@ -36,7 +36,7 @@ along with OpenRS. If not, see . #define SINTEF_ECLIPSEGRIDINSPECTOR_HEADER #include -#include +#include namespace Dune @@ -76,22 +76,22 @@ public: std::pair cellDips(int cell_idx) const; // Convert global cell index to logical ijk-coordinates - boost::array cellIdxToLogicalCoords(int cell_idx) const; + std::tr1::array cellIdxToLogicalCoords(int cell_idx) const; /// Returns a vector with the outer limits of grid (in the grid's unit). /// The vector contains [xmin, xmax, ymin, ymax, zmin, zmax], as /// read from COORDS and ZCORN - boost::array getGridLimits() const; + std::tr1::array getGridLimits() const; /// Returns the extent of the logical cartesian grid /// as number of cells in the (i, j, k) directions. - boost::array gridSize() const; + std::tr1::array gridSize() const; /// Returns the eight z-values associated with a given cell. /// The ordering is such that i runs fastest. That is, with /// L = low and H = high: /// {LLL, HLL, LHL, HHL, LLH, HLH, LHH, HHH }. - boost::array cellZvals(int i, int j, int k) const; + std::tr1::array cellZvals(int i, int j, int k) const; private: const EclipseGridParser& parser_; diff --git a/opm/core/eclipse/EclipseGridParser.cpp b/opm/core/eclipse/EclipseGridParser.cpp index 199c140c..bf80f2e8 100644 --- a/opm/core/eclipse/EclipseGridParser.cpp +++ b/opm/core/eclipse/EclipseGridParser.cpp @@ -42,12 +42,12 @@ #include #include #include -#include "EclipseGridParser.hpp" -#include "EclipseGridParserHelpers.hpp" -#include "SpecialEclipseFields.hpp" -#include +#include +#include +#include +#include #include -#include +#include using namespace std; diff --git a/opm/core/eclipse/EclipseGridParser.hpp b/opm/core/eclipse/EclipseGridParser.hpp index 4a922864..59899633 100644 --- a/opm/core/eclipse/EclipseGridParser.hpp +++ b/opm/core/eclipse/EclipseGridParser.hpp @@ -41,9 +41,9 @@ along with OpenRS. If not, see . #include #include #include -#include -#include -#include +#include +#include +#include namespace Dune { diff --git a/opm/core/eclipse/EclipseGridParserHelpers.hpp b/opm/core/eclipse/EclipseGridParserHelpers.hpp index 382b0a90..1b1b8e45 100644 --- a/opm/core/eclipse/EclipseGridParserHelpers.hpp +++ b/opm/core/eclipse/EclipseGridParserHelpers.hpp @@ -40,8 +40,8 @@ #include #include #include -#include -#include +#include +#include #include namespace Dune diff --git a/opm/core/eclipse/SpecialEclipseFields.hpp b/opm/core/eclipse/SpecialEclipseFields.hpp index 81373ef3..29d98615 100644 --- a/opm/core/eclipse/SpecialEclipseFields.hpp +++ b/opm/core/eclipse/SpecialEclipseFields.hpp @@ -40,9 +40,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include namespace Dune { diff --git a/opm/core/utility/parameters/Makefile.am b/opm/core/utility/parameters/Makefile.am index 7eb2ffc2..83fef261 100644 --- a/opm/core/utility/parameters/Makefile.am +++ b/opm/core/utility/parameters/Makefile.am @@ -3,7 +3,7 @@ SUBDIRS = tinyxml . test -paramdir = $(includedir)/dune/common/param +paramdir = $(includedir)/opm/core/utility/parameters/param param_HEADERS = Parameter.hpp ParameterGroup.hpp ParameterGroup_impl.hpp \ ParameterMapItem.hpp ParameterRequirement.hpp \ diff --git a/opm/core/utility/parameters/Parameter.cpp b/opm/core/utility/parameters/Parameter.cpp index dfb27b9d..f84b6867 100644 --- a/opm/core/utility/parameters/Parameter.cpp +++ b/opm/core/utility/parameters/Parameter.cpp @@ -37,7 +37,7 @@ along with OpenRS. If not, see . #include "config.h" #endif #include -#include +#include namespace Dune { namespace parameter { diff --git a/opm/core/utility/parameters/Parameter.hpp b/opm/core/utility/parameters/Parameter.hpp index 078e7416..3ec9021c 100644 --- a/opm/core/utility/parameters/Parameter.hpp +++ b/opm/core/utility/parameters/Parameter.hpp @@ -39,8 +39,8 @@ along with OpenRS. If not, see . #include #include -#include -#include +#include +#include namespace Dune { /// See ParameterGroup.hpp for how to use the parameter system diff --git a/opm/core/utility/parameters/ParameterGroup.cpp b/opm/core/utility/parameters/ParameterGroup.cpp index bc6ca9f4..daca3f89 100644 --- a/opm/core/utility/parameters/ParameterGroup.cpp +++ b/opm/core/utility/parameters/ParameterGroup.cpp @@ -36,17 +36,17 @@ along with OpenRS. If not, see . #if HAVE_CONFIG_H #include "config.h" #endif -#include +#include #include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace Dune { namespace parameter { diff --git a/opm/core/utility/parameters/ParameterGroup.hpp b/opm/core/utility/parameters/ParameterGroup.hpp index ecfe0684..b217267c 100644 --- a/opm/core/utility/parameters/ParameterGroup.hpp +++ b/opm/core/utility/parameters/ParameterGroup.hpp @@ -42,8 +42,8 @@ along with OpenRS. If not, see . #include #include -#include -#include +#include +#include namespace Dune { namespace parameter { @@ -287,6 +287,6 @@ namespace Dune { } // namespace parameter } // namespace Dune -#include +#include #endif // OPENRS_PARAMETERGROUP_HEADER diff --git a/opm/core/utility/parameters/ParameterGroup_impl.hpp b/opm/core/utility/parameters/ParameterGroup_impl.hpp index 3ef77a72..cfedc2be 100644 --- a/opm/core/utility/parameters/ParameterGroup_impl.hpp +++ b/opm/core/utility/parameters/ParameterGroup_impl.hpp @@ -39,11 +39,9 @@ along with OpenRS. If not, see . #include #include -//#include "TermColors.hpp" // from utils - -#include -#include -#include +#include +#include +#include namespace Dune { namespace parameter { diff --git a/opm/core/utility/parameters/ParameterTools.cpp b/opm/core/utility/parameters/ParameterTools.cpp index f034be71..0a4a0d9a 100644 --- a/opm/core/utility/parameters/ParameterTools.cpp +++ b/opm/core/utility/parameters/ParameterTools.cpp @@ -36,8 +36,8 @@ along with OpenRS. If not, see . #if HAVE_CONFIG_H #include "config.h" #endif -#include -#include +#include +#include namespace Dune { namespace parameter { diff --git a/opm/core/utility/parameters/ParameterXML.cpp b/opm/core/utility/parameters/ParameterXML.cpp index 4e69a0ac..44c5d667 100644 --- a/opm/core/utility/parameters/ParameterXML.cpp +++ b/opm/core/utility/parameters/ParameterXML.cpp @@ -36,9 +36,9 @@ along with OpenRS. If not, see . #if HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include +#include +#include +#include #include #include @@ -46,7 +46,7 @@ along with OpenRS. If not, see . #include -#include +#include diff --git a/opm/core/utility/parameters/ParameterXML.hpp b/opm/core/utility/parameters/ParameterXML.hpp index 0e5b58dd..3d395cb2 100644 --- a/opm/core/utility/parameters/ParameterXML.hpp +++ b/opm/core/utility/parameters/ParameterXML.hpp @@ -36,7 +36,7 @@ along with OpenRS. If not, see . #ifndef OPENRS_PARAMETERXML_HEADER #define OPENRS_PARAMETERXML_HEADER -#include +#include namespace Dune { namespace parameter {