Now library contents build. Headers and tests not done yet.

This commit is contained in:
Atgeirr Flø Rasmussen 2011-12-19 12:36:56 +01:00
parent 7e90e732d9
commit 81b58a0acf
17 changed files with 70 additions and 60 deletions

View File

@ -7,6 +7,17 @@ SUBDIRS = . tests examples
lib_LTLIBRARIES = libopmcore.la lib_LTLIBRARIES = libopmcore.la
libopmcore_la_SOURCES = \ 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/cart_grid.c \
opm/core/utility/cpgpreprocess/geometry.c \ opm/core/utility/cpgpreprocess/geometry.c \
opm/core/utility/cpgpreprocess/preprocess.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/sparsetable.c \
opm/core/utility/cpgpreprocess/facetopology.c \ opm/core/utility/cpgpreprocess/facetopology.c \
opm/core/utility/cpgpreprocess/uniquepoints.c \ opm/core/utility/cpgpreprocess/uniquepoints.c \
opm/core/utility/StopWatch.cpp \
opm/core/linalg/sparse_sys.c \ opm/core/linalg/sparse_sys.c \
opm/core/pressure/cfsh.c \ opm/core/pressure/cfsh.c \
opm/core/pressure/flow_bc.c \ opm/core/pressure/flow_bc.c \

View File

@ -20,8 +20,8 @@
#ifndef OPM_CORNERPOINTCHOPPER_HEADER_INCLUDED #ifndef OPM_CORNERPOINTCHOPPER_HEADER_INCLUDED
#define OPM_CORNERPOINTCHOPPER_HEADER_INCLUDED #define OPM_CORNERPOINTCHOPPER_HEADER_INCLUDED
#include <dune/common/EclipseGridParser.hpp> #include <opm/core/eclipse/EclipseGridParser.hpp>
#include <dune/common/param/ParameterGroup.hpp> #include <opm/core/eclipse/param/ParameterGroup.hpp>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <string> #include <string>

View File

@ -42,9 +42,9 @@
#include <cmath> #include <cmath>
#include <cfloat> #include <cfloat>
#include <algorithm> #include <algorithm>
#include <dune/common/EclipseGridInspector.hpp> #include <opm/core/eclipse/EclipseGridInspector.hpp>
#include <dune/common/EclipseGridParser.hpp> #include <opm/core/eclipse/EclipseGridParser.hpp>
#include <dune/common/SpecialEclipseFields.hpp> #include <opm/core/eclipse/SpecialEclipseFields.hpp>
namespace Dune namespace Dune
{ {
@ -100,7 +100,7 @@ std::pair<double,double> EclipseGridInspector::cellDips(int i, int j, int k) con
} }
// Pick ZCORN-value for all 8 corners of the given cell // Pick ZCORN-value for all 8 corners of the given cell
boost::array<double, 8> cellz = cellZvals(i, j, k); std::tr1::array<double, 8> cellz = cellZvals(i, j, k);
// Compute rise in positive x-direction for all four edges (and then find mean) // Compute rise in positive x-direction for all four edges (and then find mean)
// Current implementation is for regularly placed and vertical pillars! // Current implementation is for regularly placed and vertical pillars!
@ -125,7 +125,7 @@ std::pair<double,double> EclipseGridInspector::cellDips(int i, int j, int k) con
// don't follow an overall dip for the model if it exists. // don't follow an overall dip for the model if it exists.
int x_edges = 4; int x_edges = 4;
int y_edges = 4; int y_edges = 4;
boost::array<double, 6> gridlimits = getGridLimits(); std::tr1::array<double, 6> gridlimits = getGridLimits();
double zmin = gridlimits[4]; double zmin = gridlimits[4];
double zmax = gridlimits[5]; double zmax = gridlimits[5];
// LLL -> HLL // LLL -> HLL
@ -169,11 +169,11 @@ std::pair<double,double> EclipseGridInspector::cellDips(int i, int j, int k) con
*/ */
std::pair<double,double> EclipseGridInspector::cellDips(int cell_idx) const std::pair<double,double> EclipseGridInspector::cellDips(int cell_idx) const
{ {
boost::array<int, 3> idxs = cellIdxToLogicalCoords(cell_idx); std::tr1::array<int, 3> idxs = cellIdxToLogicalCoords(cell_idx);
return cellDips(idxs[0], idxs[1], idxs[2]); return cellDips(idxs[0], idxs[1], idxs[2]);
} }
boost::array<int, 3> EclipseGridInspector::cellIdxToLogicalCoords(int cell_idx) const std::tr1::array<int, 3> EclipseGridInspector::cellIdxToLogicalCoords(int cell_idx) const
{ {
int i,j,k; // Position of cell in cell hierarchy int i,j,k; // Position of cell in cell hierarchy
@ -188,8 +188,8 @@ boost::array<int, 3> EclipseGridInspector::cellIdxToLogicalCoords(int cell_idx)
j = (horIdx-i)/logical_gridsize_[0]+1; j = (horIdx-i)/logical_gridsize_[0]+1;
k = ((cell_idx+1)-logical_gridsize_[0]*(j-1)-1)/(logical_gridsize_[0]*logical_gridsize_[1])+1; k = ((cell_idx+1)-logical_gridsize_[0]*(j-1)-1)/(logical_gridsize_[0]*logical_gridsize_[1])+1;
boost::array<int, 3> a = {{i-1, j-1, k-1}}; std::tr1::array<int, 3> a = {{i-1, j-1, k-1}};
return a; //boost::array<int, 3> {{i-1, j-1, k-1}}; return a; //std::tr1::array<int, 3> {{i-1, j-1, k-1}};
} }
double EclipseGridInspector::cellVolumeVerticalPillars(int i, int j, int k) const 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 double EclipseGridInspector::cellVolumeVerticalPillars(int cell_idx) const
{ {
boost::array<int, 3> idxs = cellIdxToLogicalCoords(cell_idx); std::tr1::array<int, 3> idxs = cellIdxToLogicalCoords(cell_idx);
return cellVolumeVerticalPillars(idxs[0], idxs[1], idxs[2]); return cellVolumeVerticalPillars(idxs[0], idxs[1], idxs[2]);
} }
@ -257,7 +257,7 @@ void EclipseGridInspector::checkLogicalCoords(int i, int j, int k) const
} }
boost::array<double, 6> EclipseGridInspector::getGridLimits() const std::tr1::array<double, 6> EclipseGridInspector::getGridLimits() const
{ {
if (! (parser_.hasField("COORD") && parser_.hasField("ZCORN") && parser_.hasField("SPECGRID")) ) { 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."); throw std::runtime_error("EclipseGridInspector: Grid does not have SPECGRID, COORD, and ZCORN, can't find dimensions.");
@ -293,7 +293,7 @@ boost::array<double, 6> EclipseGridInspector::getGridLimits() const
ymin = coord[pillarindex * 6 + 4]; ymin = coord[pillarindex * 6 + 4];
} }
boost::array<double, 6> gridlimits = {{ xmin, xmax, ymin, ymax, std::tr1::array<double, 6> gridlimits = {{ xmin, xmax, ymin, ymax,
*min_element(zcorn.begin(), zcorn.end()), *min_element(zcorn.begin(), zcorn.end()),
*max_element(zcorn.begin(), zcorn.end()) }}; *max_element(zcorn.begin(), zcorn.end()) }};
return gridlimits; return gridlimits;
@ -301,16 +301,16 @@ boost::array<double, 6> EclipseGridInspector::getGridLimits() const
boost::array<int, 3> EclipseGridInspector::gridSize() const std::tr1::array<int, 3> EclipseGridInspector::gridSize() const
{ {
boost::array<int, 3> retval = {{ logical_gridsize_[0], std::tr1::array<int, 3> retval = {{ logical_gridsize_[0],
logical_gridsize_[1], logical_gridsize_[1],
logical_gridsize_[2] }}; logical_gridsize_[2] }};
return retval; return retval;
} }
boost::array<double, 8> EclipseGridInspector::cellZvals(int i, int j, int k) const std::tr1::array<double, 8> EclipseGridInspector::cellZvals(int i, int j, int k) const
{ {
// Get the zcorn field. // Get the zcorn field.
const std::vector<double>& z = parser_.getFloatingPointValue("ZCORN"); const std::vector<double>& z = parser_.getFloatingPointValue("ZCORN");
@ -324,7 +324,7 @@ boost::array<double, 8> EclipseGridInspector::cellZvals(int i, int j, int k) con
2*logical_gridsize_[0], 2*logical_gridsize_[0],
4*logical_gridsize_[0]*logical_gridsize_[1] }; 4*logical_gridsize_[0]*logical_gridsize_[1] };
int ix = 2*(i*delta[0] + j*delta[1] + k*delta[2]); int ix = 2*(i*delta[0] + j*delta[1] + k*delta[2]);
boost::array<double, 8> cellz = {{ z[ix], z[ix + delta[0]], std::tr1::array<double, 8> cellz = {{ z[ix], z[ix + delta[0]],
z[ix + delta[1]], z[ix + delta[1] + 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]], z[ix + delta[2] + delta[0]],
z[ix + delta[2] + delta[1]], z[ix + delta[2] + delta[1] + delta[0]] }}; z[ix + delta[2] + delta[1]], z[ix + delta[2] + delta[1] + delta[0]] }};

View File

@ -36,7 +36,7 @@ along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
#define SINTEF_ECLIPSEGRIDINSPECTOR_HEADER #define SINTEF_ECLIPSEGRIDINSPECTOR_HEADER
#include <vector> #include <vector>
#include <boost/array.hpp> #include <tr1/array>
namespace Dune namespace Dune
@ -76,22 +76,22 @@ public:
std::pair<double,double> cellDips(int cell_idx) const; std::pair<double,double> cellDips(int cell_idx) const;
// Convert global cell index to logical ijk-coordinates // Convert global cell index to logical ijk-coordinates
boost::array<int, 3> cellIdxToLogicalCoords(int cell_idx) const; std::tr1::array<int, 3> cellIdxToLogicalCoords(int cell_idx) const;
/// Returns a vector with the outer limits of grid (in the grid's unit). /// Returns a vector with the outer limits of grid (in the grid's unit).
/// The vector contains [xmin, xmax, ymin, ymax, zmin, zmax], as /// The vector contains [xmin, xmax, ymin, ymax, zmin, zmax], as
/// read from COORDS and ZCORN /// read from COORDS and ZCORN
boost::array<double, 6> getGridLimits() const; std::tr1::array<double, 6> getGridLimits() const;
/// Returns the extent of the logical cartesian grid /// Returns the extent of the logical cartesian grid
/// as number of cells in the (i, j, k) directions. /// as number of cells in the (i, j, k) directions.
boost::array<int, 3> gridSize() const; std::tr1::array<int, 3> gridSize() const;
/// Returns the eight z-values associated with a given cell. /// Returns the eight z-values associated with a given cell.
/// The ordering is such that i runs fastest. That is, with /// The ordering is such that i runs fastest. That is, with
/// L = low and H = high: /// L = low and H = high:
/// {LLL, HLL, LHL, HHL, LLH, HLH, LHH, HHH }. /// {LLL, HLL, LHL, HHL, LLH, HLH, LHH, HHH }.
boost::array<double, 8> cellZvals(int i, int j, int k) const; std::tr1::array<double, 8> cellZvals(int i, int j, int k) const;
private: private:
const EclipseGridParser& parser_; const EclipseGridParser& parser_;

View File

@ -42,12 +42,12 @@
#include <algorithm> #include <algorithm>
#include <limits> #include <limits>
#include <cfloat> #include <cfloat>
#include "EclipseGridParser.hpp" #include <opm/core/eclipse/EclipseGridParser.hpp>
#include "EclipseGridParserHelpers.hpp" #include <opm/core/eclipse/EclipseGridParserHelpers.hpp>
#include "SpecialEclipseFields.hpp" #include <opm/core/eclipse/SpecialEclipseFields.hpp>
#include <dune/common/ErrorMacros.hpp> #include <opm/core/utility/ErrorMacros.hpp>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <dune/common/Units.hpp> #include <opm/core/utility/Units.hpp>
using namespace std; using namespace std;

View File

@ -41,9 +41,9 @@ along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
#include <map> #include <map>
#include <set> #include <set>
#include <tr1/memory> #include <tr1/memory>
#include <dune/common/SpecialEclipseFields.hpp> #include <opm/core/eclipse/SpecialEclipseFields.hpp>
#include <dune/common/EclipseUnits.hpp> #include <opm/core/eclipse/EclipseUnits.hpp>
#include <dune/common/Factory.hpp> #include <opm/core/utility/Factory.hpp>
namespace Dune namespace Dune
{ {

View File

@ -40,8 +40,8 @@
#include <string> #include <string>
#include <istream> #include <istream>
#include <vector> #include <vector>
#include <dune/common/ErrorMacros.hpp> #include <opm/core/utility/ErrorMacros.hpp>
#include <dune/common/linInt.hpp> #include <opm/core/utility/linInt.hpp>
#include <boost/date_time/gregorian/gregorian.hpp> #include <boost/date_time/gregorian/gregorian.hpp>
namespace Dune namespace Dune

View File

@ -40,9 +40,9 @@
#include <string> #include <string>
#include <fstream> #include <fstream>
#include <limits> #include <limits>
#include <dune/common/ErrorMacros.hpp> #include <opm/core/utility/ErrorMacros.hpp>
#include <dune/common/EclipseGridParserHelpers.hpp> #include <opm/core/eclipse/EclipseGridParserHelpers.hpp>
#include <dune/common/EclipseUnits.hpp> #include <opm/core/eclipse/EclipseUnits.hpp>
namespace Dune namespace Dune
{ {

View File

@ -3,7 +3,7 @@
SUBDIRS = tinyxml . test SUBDIRS = tinyxml . test
paramdir = $(includedir)/dune/common/param paramdir = $(includedir)/opm/core/utility/parameters/param
param_HEADERS = Parameter.hpp ParameterGroup.hpp ParameterGroup_impl.hpp \ param_HEADERS = Parameter.hpp ParameterGroup.hpp ParameterGroup_impl.hpp \
ParameterMapItem.hpp ParameterRequirement.hpp \ ParameterMapItem.hpp ParameterRequirement.hpp \

View File

@ -37,7 +37,7 @@ along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
#include "config.h" #include "config.h"
#endif #endif
#include <string> #include <string>
#include <dune/common/param/Parameter.hpp> #include <opm/core/utility/parameters/Parameter.hpp>
namespace Dune { namespace Dune {
namespace parameter { namespace parameter {

View File

@ -39,8 +39,8 @@ along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <dune/common/param/ParameterMapItem.hpp> #include <opm/core/utility/parameters/ParameterMapItem.hpp>
#include <dune/common/param/ParameterStrings.hpp> #include <opm/core/utility/parameters/ParameterStrings.hpp>
namespace Dune { namespace Dune {
/// See ParameterGroup.hpp for how to use the parameter system /// See ParameterGroup.hpp for how to use the parameter system

View File

@ -36,17 +36,17 @@ along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <dune/common/param/ParameterGroup.hpp> #include <opm/core/utility/parameters/ParameterGroup.hpp>
#include <cassert> #include <cassert>
#include <cstdlib> #include <cstdlib>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <dune/common/param/Parameter.hpp> #include <opm/core/utility/parameters/Parameter.hpp>
#include <dune/common/param/ParameterStrings.hpp> #include <opm/core/utility/parameters/ParameterStrings.hpp>
#include <dune/common/param/ParameterTools.hpp> #include <opm/core/utility/parameters/ParameterTools.hpp>
#include <dune/common/param/ParameterXML.hpp> #include <opm/core/utility/parameters/ParameterXML.hpp>
namespace Dune { namespace Dune {
namespace parameter { namespace parameter {

View File

@ -42,8 +42,8 @@ along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
#include <vector> #include <vector>
#include <tr1/memory> #include <tr1/memory>
#include <dune/common/param/ParameterMapItem.hpp> #include <opm/core/utility/parameters/ParameterMapItem.hpp>
#include <dune/common/param/ParameterRequirement.hpp> #include <opm/core/utility/parameters/ParameterRequirement.hpp>
namespace Dune { namespace Dune {
namespace parameter { namespace parameter {
@ -287,6 +287,6 @@ namespace Dune {
} // namespace parameter } // namespace parameter
} // namespace Dune } // namespace Dune
#include <dune/common/param/ParameterGroup_impl.hpp> #include <opm/core/utility/parameters/ParameterGroup_impl.hpp>
#endif // OPENRS_PARAMETERGROUP_HEADER #endif // OPENRS_PARAMETERGROUP_HEADER

View File

@ -39,11 +39,9 @@ along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
#include <iostream> #include <iostream>
#include <string> #include <string>
//#include "TermColors.hpp" // from utils #include <opm/core/utility/parameters/ParameterStrings.hpp>
#include <opm/core/utility/parameters/ParameterTools.hpp>
#include <dune/common/param/ParameterStrings.hpp> #include <opm/core/utility/parameters/Parameter.hpp>
#include <dune/common/param/ParameterTools.hpp>
#include <dune/common/param/Parameter.hpp>
namespace Dune { namespace Dune {
namespace parameter { namespace parameter {

View File

@ -36,8 +36,8 @@ along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <dune/common/param/ParameterTools.hpp> #include <opm/core/utility/parameters/ParameterTools.hpp>
#include <dune/common/param/ParameterStrings.hpp> #include <opm/core/utility/parameters/ParameterStrings.hpp>
namespace Dune { namespace Dune {
namespace parameter { namespace parameter {

View File

@ -36,9 +36,9 @@ along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <dune/common/param/ParameterXML.hpp> #include <opm/core/utility/parameters/ParameterXML.hpp>
#include <dune/common/param/Parameter.hpp> #include <opm/core/utility/parameters/Parameter.hpp>
#include <dune/common/param/ParameterStrings.hpp> #include <opm/core/utility/parameters/ParameterStrings.hpp>
#include <exception> #include <exception>
#include <iostream> #include <iostream>
@ -46,7 +46,7 @@ along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <dune/common/param/tinyxml/tinyxml.h> #include <opm/core/utility/parameters/tinyxml/tinyxml.h>

View File

@ -36,7 +36,7 @@ along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
#ifndef OPENRS_PARAMETERXML_HEADER #ifndef OPENRS_PARAMETERXML_HEADER
#define OPENRS_PARAMETERXML_HEADER #define OPENRS_PARAMETERXML_HEADER
#include <dune/common/param/ParameterGroup.hpp> #include <opm/core/utility/parameters/ParameterGroup.hpp>
namespace Dune { namespace Dune {
namespace parameter { namespace parameter {